This SilverStripe module generates webp images from resized jpeg and png images.
- SilverStripe ^4.0
- GD with webp support
composer require webmen/silverstripe-webp-images
Next, you'll need to run a dev/build
(or at least flush
) to allow access to files with the .webp
extension from the .htaccess
in your assets
directory.
SilverStripe\Core\Injector\Injector:
TheWebmen\WebpImages\Assets\WebpGenerator:
properties:
enabled: true
quality: 80
To disable generating webp images in code
WebpGenerator::singleton()->setEnabled(false)
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.