justbetter/magento2-image-optimizer 1.0.0

Magento 2 Image optimizer wrapper build on https://github.com/spatie/image-optimize

Type

magento2-module

License

MIT

Requires
Requires (dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

Magento 2 Image Optimizer

This Magento 2 module is a wrapper based on the package Spatie Image optimizer.

Installation

  • composer require justbetter/magento2-image-optimizer
  • bin/magento module:enable JustBetter_ImageOptimizer
  • bin/magento setup:upgrade && bin/magento setup:static-content:deploy

Optimization tools

The package will use these optimizers if they are present on your system:

Here's how to install all the optimizers on Ubuntu:

sudo apt-get install jpegoptim
sudo apt-get install optipng
sudo apt-get install pngquant
sudo npm install -g svgo
sudo apt-get install gifsicle

And here's how to install the binaries on MacOS (using Homebrew):

brew install jpegoptim
brew install optipng
brew install pngquant
brew install svgo
brew install gifsicle

Configuration

  • Options for the module are defined in the backend under Stores > Configuration > Justbetter > Image optimizer configuration.
  • Currently the only option available is to log the compression.

Compability

The module is tested on magento version 2.2.x with Spatie image optimizer version 1.0.x

Ideas, bugs or suggestions?

Please create a issue or a pull request.

Todo

  • Configurable options for compression
  • Compress all library images in console command

License

MIT


JustBetter logo