[wp-trac] [WordPress Trac] #35725: Add WebP support.
WordPress Trac
noreply at wordpress.org
Thu Apr 1 21:53:54 UTC 2021
#35725: Add WebP support.
-------------------------------------------------+-------------------------
Reporter: markoheijnen | Owner:
| adamsilverstein
Type: enhancement | Status: assigned
Priority: normal | Milestone: 5.8
Component: Media | Version: 3.5
Severity: normal | Resolution:
Keywords: has-patch needs-testing has-unit- | Focuses:
tests needs-dev-note dev-feedback |
-------------------------------------------------+-------------------------
Comment (by adamsilverstein):
[attachment:"35725.19.diff"] (and also on the PR):
* Add `wp_get_webp_info` which gets a webp image width, height and type by
reading the file headers.
* Add `_wp_webp_is_lossy` which returns `true` if the file is a lossy WebP
* In `src/wp-includes/class-wp-image-editor-imagick.php:set_quality` if
the file is a WebP file, check if it is a lossless image (!lossy) and if
so, ''set Imagick to use lossless output''.
In addition to testing this manually it would be good to add an automated
test that verifies it works as expected. Note: this only works for
Imagick, with GD all uploaded WebP images will be converted to lossy image
subsizes.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35725#comment:150>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list