Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.01 KB

README.md

File metadata and controls

37 lines (25 loc) · 1.01 KB

Glide Optimizer Manipulator

Software License Packagist Version

This manipulator uses ps/image-optimizer package to minify resources.

Inspired by https://github.com/approached/laravel-image-optimizer

Installation

  • Recommend convert packages:
sudo apt-get install pngquant gifsicle jpegoptim
  • Require this package with composer:
composer require infinityweb/glide-optimizer

Usage

$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.