axllent/silverstripe-image-optimiser
Automatically optimise all uploaded & resampled images in Silverstripe
Maintainers
Package info
github.com/axllent/silverstripe-image-optimiser
Type:silverstripe-vendormodule
pkg:composer/axllent/silverstripe-image-optimiser
Requires
- silverstripe/assets: ^1.10 || ^2.0 || ^3.0
- silverstripe/framework: ^4.0 || ^5.0 || ^6.0
- spatie/image-optimizer: ^1.6.4
Requires (Dev)
None
Suggests
- axllent/silverstripe-scaled-uploads: Automatically scale down large uploaded images
Provides
None
Conflicts
None
Replaces
None
MIT 357098efae30b66abfe3ce2a6f3b67b4ac9ef0d2
README
A module to automatically optimise/compress uploaded as well as any resampled (cropped, scaled etc) images in Silverstripe. Images (JPG, PNG & GIF) are automatically optimised, provided you have the correct binaries installed (see "Installation" below).
The module overrides the default FlysystemAssetStore to and transparently optimises
the image before adding the image to the store.
Requirements
silverstripe/framework^4.0 || ^5.0 || ^6.0silverstripe/assets^1.10 || ^2.0 || ^3.0- spatie/image-optimizer - automatically installed
- JpegOptim, Optipng, Pngquant 2 & Gifsicle binaries (see below)
Optimisation tools
The module uses spatie/image-optimizer and will use the following optimisers if they are both present and in your default path on your system:
Installation
composer require axllent/silverstripe-image-optimiser
Installing the utilities on Ubuntu:
sudo apt-get install jpegoptim optipng pngquant gifsicle
Installing the utilities on Alpine Linux:
apk add jpegoptim optipng pngquant gifsicle
Usage
Assuming you have the necessary binaries installed, it should "just work" with the default settings once you have flushed your Silverstripe installation.
For custom optimisation settings, please refer to the Configuration documentation.
