Image Optimizer for Winter CMS

March 12, 2022 ยท View on GitHub

Automatically optimizes images on upload/resize.

Installation

  • git clone to /plugins/flynsarmy/imageoptimizer
  • composer update
  • php artisan plugin:refresh Flynsarmy.ImageOptimizer

Description

This plugin uses spatie/image-optimizer to optimize images on upload and resize. It requires various binaries to be installed on your system to handle the optimizations. At the time of writing this plugin supports the following image types:

For full details, see spatie/image-optimizer

A settings page has been provided at Backend - Settings - Image Optimizer which lists supported binaries and whether or not they're installed on the system.

Command Line

Two artisan commands have been added:

  1. php artisan imageoptimizer:optimizers lists installed optimizers.
  2. php artisan imageoptimizer:optimize <filepath> optimizes an image at a given path.