mutation / imagesoptim
Optimize images
Package info
github.com/MutationDigitale/craft3-imagesoptim
Type:craft-plugin
pkg:composer/mutation/imagesoptim
1.0.3
2019-10-30 17:31 UTC
Requires
- craftcms/cms: ^3.0.0
- spatie/image-optimizer: ^1.0
This package is auto-updated.
Last update: 2026-03-05 06:19:46 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 jpegoptimsudo apt-get install optipngsudo apt-get install pngquantsudo npm install -g svgosudo 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') }}" >