crocodile2u / imgproxy-php
URL generator for darthsim/imgproxy
Installs: 3 559
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 1
Forks: 2
Open Issues: 1
Requires
- php: >=7.2
Requires (Dev)
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2021-03-19 17:59:11 UTC
README
See https://github.com/DarthSim/imgproxy.
This is a small package which allows for generating URLs for your images that are resized by imgproxy:
$builder = new UrlBuilder("http://localhost:8080", "< your HEX key >", "< you HEX salt >"); // Generate imgproxy URL for an image, resizing to 300x200 with default settings (*) $url = $builder->build("http://myimages.localhost/cats.jpg", 300, 200); echo $url->toString(); // Customize URL params $url->setFit("fill") ->setWidth(1200) ->setHeight(1200) ->setGravity("no") ->setEnlarge(true); echo $url->toString();
(*) default settings:
- Fit: fit
- Gravity: sm (smart)
- Enlarge: 0 (do not enlarge images)
Please refer to imgproxy docs for parameter descriptions and possible values.