mutation/imagesoptim

Optimize images

Installs: 3 143

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 1

Open Issues: 0

Type:craft-plugin

pkg:composer/mutation/imagesoptim

1.0.3 2019-10-30 17:31 UTC

This package is auto-updated.

Last update: 2025-10-05 05:19:40 UTC


README

Compress images with image-optimizer (https://github.com/spatie/image-optimizer). Those following dependencies must be installed on the server:

  • 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

After, you can do that in twig (format in jpg in case the client uploads png images for photos):

<img src="{{ asset.getUrl({mode: 'crop', width: 100, height: 100, format: 'jpg') }}" >