Download the PHP package fuzz/image-resizer without Composer
On this page you can find all versions of the php package fuzz/image-resizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fuzz/image-resizer
More information about fuzz/image-resizer
Files in fuzz/image-resizer
Package image-resizer
Short Description Image Resizing micro service.
License MIT
Homepage https://fuzzproductions.com/
Informations about the package image-resizer
Fuzz Image Resizer
A lightweight PHP image resizer
Out of the box usage
- Run
composer install
- Set up environment variables
- Resize your images
Setup
The image resizer is intended to live as a standalone microservice behind a CDN. The first request for a query combination http://resizer-url.com/resize/?source=http://image-source.com/images/image.jpg&height=300&width=400
will fall through to the resizer instance but any subsequent requests should be cached by the CDN.
Environment Variables
The resizer depends on a few configurable environment variables (can be loaded from a dotenv file):
ALLOWED_HOSTS
- a comma separated string of whitelisted domainsCACHE_EXPIRATION_HOURS
- length (in hours) to setCache-Control
with themax-age
directive andExpires
headers. Any CDN should obey your cache rules and cache objects appropriately.APP_ENV
- app environment
Best Practices
In light of exploits like https://imagetragick.com/, we recommend that your implementation:
- Uses the latest version of ImageMagick
- Follows mitigation procedures listed on https://imagetragick.com/
- Has severely restricted access to any other resources (on the same network or otherwise)
- Only processes images from sources you whitelist
Healthcheck
healthcheck.php
will return a 200 for Load Balancer health pings.
Tests
Run phpunit
All versions of image-resizer with dependencies
ext-imagick Version *
symfony/http-foundation Version 2.7.3
vlucas/phpdotenv Version ^2.0
nesbot/carbon Version ^1.20