Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: Quality setting ignored when generating webp transforms #13998

Closed
chrishind10 opened this issue Dec 6, 2023 · 2 comments
Closed

[4.x]: Quality setting ignored when generating webp transforms #13998

chrishind10 opened this issue Dec 6, 2023 · 2 comments
Assignees

Comments

@chrishind10
Copy link

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 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

  1. Upload a reasonably large photo
  2. Generate a transform in webp format with a quality of 100
  3. 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
@i-just
Copy link
Contributor

i-just commented Dec 8, 2023

Hi, thanks for reporting and for all the details! I just raised a PR with your suggestion.

@brandonkelly
Copy link
Member

Craft 4.5.12 is out with the fix for this. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants