fuzz / image-resizer
This package is abandoned and no longer maintained.
No replacement package was suggested.
Image Resizing micro service.
1.1
2016-05-03 17:58 UTC
Requires
- php: >=5.5.0
- ext-imagick: *
- nesbot/carbon: ^1.20
- symfony/http-foundation: 2.7.3
- vlucas/phpdotenv: ^2.0
Requires (Dev)
- phpunit/phpunit: 5.0.*
This package is not auto-updated.
Last update: 2024-05-02 14:12:59 UTC
README
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