apanaj / client-optimager
Client For Image Optimizer Service.
Installs: 62
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/apanaj/client-optimager
Requires
- poirot/api-client: dev-devel
- poirot/http: dev-devel
This package is not auto-updated.
Last update: 2025-09-28 09:45:34 UTC
README
php client for image optimizer service.
// Resize Image: // from url $c = new \Apanaj\Optimager\Client('http://apanaj_optimizer-image'); $img = $c->optimize( (new \Apanaj\Optimager\Client\Command\Optimize()) ->fromUrl('https://helloworld.co.nz/images/helloworld-logo.jpg') ->crop(90, 90) ->quality(100) ); header('Content-Type: image/jpeg'); echo stream_get_contents($img); die; // Resize Image: // from stream or file $c = new \Apanaj\Optimager\Client('http://apanaj_optimizer-image'); $img = $c->optimize( (new \Apanaj\Optimager\Client\Command\Optimize()) ->fromStream(fopen('https://helloworld.co.nz/images/helloworld-logo.jpg', 'rb')) ->resize(90, 90) ->quality(100) );