This manipulator uses spatie/image-optimizer package to minify resources.
Forked from https://github.com/infinityweb/glide-optimizer
-
Recommend convert packages: Look in the Spatie installation instructions
-
Require this package with composer:
composer require zestic/glide-optimizer
$server = League\Glide\ServerFactory::create([
'source' => 'path/to/source/folder',
'cache' => 'path/to/cache/folder',
]);
$manipulators = $server->getApi()->getManipulators();
$manipulators[] = new Zestic\Glide\Optimizer\OptimizerManipulator();
$server->getApi()->setManipulators($manipulators);
For better optimization use imagick driver.