webp-express
webp-express copied to clipboard
Suggestion: convert from the "master" image if the file to convert is resized
Given how WordPress resizes images multiple times upon upload, converting into webp any already resized+compressed image leads to a double compression for lossy formats (it may not be worth it on .png files). Using the "master image" instead could lead to a better quality/size ratio, at the cost of a slower conversion.
Example of existing files in the WordPress installation after uploading a squared image:
- filename.jpg
- filename-100x100.jpg
- filename-150x150.jpg
- filename-300x300.jpg
- filename-600x600.jpg
- filename-768x768.jpg
- filename-1024x1024.jpg
The suggestion would be to allow the use of filename.jpg as source, if it exists, for every conversion request on one its sub-images filename-width-height.jpg, using the resizing abilities of the various libraries used. The quality detection, if enabled, would still be done on the already resized image to take into account its already degraded quality.