https://github.com/axllent/silverstripe-image-optimiser
Automatically optimise all uploaded & resampled images in Silverstripe
https://github.com/axllent/silverstripe-image-optimiser
image-optimization silverstripe-module
Last synced: 10 months ago
JSON representation
Automatically optimise all uploaded & resampled images in Silverstripe
- Host: GitHub
- URL: https://github.com/axllent/silverstripe-image-optimiser
- Owner: axllent
- License: mit
- Created: 2019-03-22T02:05:43.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-05-15T04:54:51.000Z (over 2 years ago)
- Last Synced: 2025-03-25T04:06:44.374Z (11 months ago)
- Topics: image-optimization, silverstripe-module
- Language: PHP
- Homepage:
- Size: 15.6 KB
- Stars: 11
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: Code-of-Conduct.md
Awesome Lists containing this project
README
# Optimised images for Silverstripe
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
- `silverstripe/assets` ^1.10 || ^2.0
- [spatie/image-optimizer](https://github.com/spatie/image-optimizer) - automatically installed
- JpegOptim, Optipng, Pngquant 2 & Gifsicle binaries (see below)
## Optimisation tools
The module uses [spatie/image-optimizer](https://github.com/spatie/image-optimizer) and will use the
following optimisers if they are both present and in your default path on your system:
- [JpegOptim](https://github.com/tjko/jpegoptim)
- [Optipng](http://optipng.sourceforge.net/)
- [Pngquant 2](https://pngquant.org/)
- [Gifsicle](http://www.lcdf.org/gifsicle/)
## Installation
```shell
composer require axllent/silverstripe-image-optimiser
```
### Installing the utilities on Ubuntu:
```bash
sudo apt-get install jpegoptim optipng pngquant gifsicle
```
### Installing the utilities on Alpine Linux:
```bash
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](docs/en/Configuration.md).