[wp-trac] [WordPress Trac] #53669: Respect the quality settings in `wp_editor_set_quality` for lossless WebP
WordPress Trac
noreply at wordpress.org
Thu Jul 15 14:56:26 UTC 2021
#53669: Respect the quality settings in `wp_editor_set_quality` for lossless WebP
--------------------------+-----------------------------
Reporter: mikeschroder | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: trunk
Severity: normal | Keywords: needs-patch
Focuses: |
--------------------------+-----------------------------
In Imagick, WordPress now supports saving lossless WebP images when the
source is a lossless WebP image. 🎉
This happens [https://github.com/WordPress/wordpress-
develop/blob/f17f4f5f7e474e2c0bb77ace02aaf44fccd8362c/src/wp-includes
/class-wp-image-editor-imagick.php#L208 inside the Imagick editor in
`set_quality`].
The filter, `wp_editor_set_quality`, applies before this is run, in
[https://github.com/WordPress/wordpress-
develop/blob/f17f4f5f7e474e2c0bb77ace02aaf44fccd8362c/src/wp-includes
/class-wp-image-editor.php#L241 the parent class].
This means that if a WebP is detected as Lossless, it isn't possible to
override lossless thumbnailing with `wp_editor_set_quality`.
WordPress should respect the `wp_editor_set_quality` filter's override,
[https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/
unless `set_quality()` is run manually].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53669>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list