[wp-trac] [WordPress Trac] #53653: Scaled down WebP images may be with much larger file size than the original

WordPress Trac noreply at wordpress.org
Wed Jul 14 14:32:39 UTC 2021


#53653: Scaled down WebP images may be with much larger file size than the original
---------------------------------------+---------------------
 Reporter:  azaozz                     |       Owner:  (none)
     Type:  defect (bug)               |      Status:  new
 Priority:  normal                     |   Milestone:  5.8
Component:  Media                      |     Version:  trunk
 Severity:  normal                     |  Resolution:
 Keywords:  needs-patch needs-testing  |     Focuses:
---------------------------------------+---------------------

Comment (by mikeschroder):

 Moving some of my findings over here from Slack
 ([https://wordpress.slack.com/archives/C02SX62S6/p1626268697069300
 beginning of conversation]):

 My reading of the spec
 (https://developers.google.com/speed/webp/docs/riff_container#example_file_layouts)
 agrees with @azaozz's finding that `VP8X` doesn't necessarily mean
 lossless or animated.

 Right now, core is assuming `VP8X` always means animated.

 This happens when `wp_get_webp_info()` is called here:
 https://github.com/WordPress/wordpress-develop/blob/master/src/wp-includes
 /class-wp-image-editor-imagick.php#L206

 Then, `VP8X` sets `animated-alpha` as the type:
 https://github.com/WordPress/wordpress-
 develop/blob/4eb17be18cdf7b2cf8e4dd4e4511dda76a5e9a11/src/wp-
 includes/media.php#L5170

 So a lossy WebP from Gimp, for instance, is detected as animated, then
 saved as lossless.

 `webpinfo` indicates that the files from Gimp, whether lossy or lossless,
 are valid, and all use `VP8X`, regardless of the extra info I tell it to
 include.


 Lastly, I think this a separate issue, but to make sure it's documented --
 When a JPEG is loaded, then saved as a WebP, only the JPEG compression
 settings are used, as `set_quality()` is run only on load, as far as I am
 aware.
 https://github.com/WordPress/wordpress-
 develop/blob/28ea7b18cf23e9e373a52cad21a739b030e3fced/src/wp-includes
 /class-wp-image-editor-imagick.php#L200

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53653#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list