infinityweb/glide-optimizer

An optimizer manipulator for Glide that uses ps/image-optimizer package.

1.1.0 2021-03-05 07:25 UTC

This package is not auto-updated.

Last update: 2021-11-27 11:19:26 UTC


README

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.