You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When transforming images to webp format, the quality setting is ignored.
After digging into Craft's code, the issue lies within the Raster class.
Line 808 within the _getSaveOptions function should be returning a webp_quality property, however it is not.
This means that imagick is left to decide its own output quality.
After patching webp_quality in myself, this fixes the problem.
Steps to reproduce
Upload a reasonably large photo
Generate a transform in webp format with a quality of 100
Generate a transform in webp format with a quality of 20
Expected behavior
The generated images would differ greatly in filesize and image quality
Actual behavior
The generated images are identical in filesize and quality.
Craft CMS version
4.5.11.1
PHP version
8.1
Operating system and version
Debian Bookworm
Database type and version
MariaDB 10.3
Image driver and version
ImageMagick 6.9.10-23
Installed plugins and versions
Amazon S3 2.0.3
CodeMirror 2.0.0
Neo 3.9.10
Read Only 1.0.5
Redactor 3.0.4
Sentry Logger 4.1.4
Super Table 3.0.12
Typed link field 2.1.5
The text was updated successfully, but these errors were encountered:
What happened?
Description
When transforming images to webp format, the quality setting is ignored.
After digging into Craft's code, the issue lies within the
Raster
class.Line 808 within the
_getSaveOptions
function should be returning awebp_quality
property, however it is not.This means that imagick is left to decide its own output quality.
After patching
webp_quality
in myself, this fixes the problem.Steps to reproduce
Expected behavior
The generated images would differ greatly in filesize and image quality
Actual behavior
The generated images are identical in filesize and quality.
Craft CMS version
4.5.11.1
PHP version
8.1
Operating system and version
Debian Bookworm
Database type and version
MariaDB 10.3
Image driver and version
ImageMagick 6.9.10-23
Installed plugins and versions
The text was updated successfully, but these errors were encountered: