This manipulator uses ps/image-optimizer package to minify resources.
Inspired by https://github.com/approached/laravel-image-optimizer
- Recommend convert packages:
sudo apt-get install pngquant gifsicle jpegoptim
- Require this package with composer:
composer require infinityweb/glide-optimizer
$server = League\Glide\ServerFactory::create([
'source' => 'path/to/source/folder',
'cache' => 'path/to/cache/folder',
]);
$manipulators = $server->getApi()->getManipulators();
$manipulators[] = new Infinityweb\Glide\Optimizer\OptimizerManipulator();
$server->getApi()->setManipulators($manipulators);
For better optimization use imagick driver.