Allow WebP quality to be configurable in GD2 image manipulation toolkit settings

Created on 11 November 2022, about 2 years ago
Updated 11 September 2024, 3 months ago

Problem/Motivation

According to PHP documentation when converting image to WebP quality argument can be passed to set the quality of the image.
In gd.php default is set to 80% and there is no way to configure or change this value.
function imagewebp($image, $to = null, $quality = 80): bool {}

Steps to reproduce

Go to /admin/config/media/image-toolkit
Select GD2 for image processing
Only JPEG quality is configurable not WebP.

Proposed resolution

Make the quality settings configurable and pass the configured value to imagewebp().

User interface changes

When selected GD2 to process images add an additional field to take the WebP quality value similar to ones taking JPEG.

Before

After

When lossless selection has been done, it hides the WebP integer field.

Feature request
Status

Needs review

Version

11.0 🔥

Component
Image system 

Last updated 2 days ago

Created by

🇩🇪Germany majid.ali

Live updates comments and jobs are added and updated live.
  • Needs usability review

    Used to alert the usability topic maintainer(s) that an issue significantly affects (or has the potential to affect) the usability of Drupal, and their signoff is needed. When adding this tag, make it easy to review the issue. Make sure the issue summary describes the problem and the proposed solution. Screenshots usually help a lot! To get sign-off on issues with the "Needs usability review" tag, post about them in the #ux channel on Drupal Slack, and/or attend a UX meeting to demo the patch and get direct feedback from designers/UX folks/product management on next steps. If an issue represents a significant new feature, UI change, or change to the general "user experience" of Drupal, use Needs product manager review instead. See the scope of responsibilities for product managers.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024