[wp-trac] [WordPress Trac] #52867: Use WebP as default format for image sub-sizes (when available).

WordPress Trac noreply at wordpress.org
Tue Mar 30 20:38:50 UTC 2021


#52867: Use WebP as default format for image sub-sizes (when available).
-------------------------------------------------+-------------------------
 Reporter:  adamsilverstein                      |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests dev-        |     Focuses:
  feedback                                       |
-------------------------------------------------+-------------------------

Comment (by adamsilverstein):

 > Question, what happens if an animated gif is uploaded? Can PHP convert
 animated gifs into animated WEBPs?

 If the server image engine supports animated WebP GIFs can get converted
 to WebP. In general GD does not support animation, only Imagick.

 > So once merged, this would generates image sub sizes as webps right?

 No, for now this **only adds a filter that gives use the capability** to
 set the default output type (given a specific input type). ''In any case,
 the specified target is only used if the system supports it.''

 I created a simple plugin for testing: https://github.com/adamsilverstein
 /wordpress-modern-images/. With the patch here applied, install this
 plugin, then choose your preferred output format under Settings->Media
 (currently only alters JPEG uploads). Try setting this to WebP and
 uploading a JPEG image to a post. The image sub-sizes used should all be
 WebP if the system supports it.


 > I personally believe that if we do this, we need an add an option on wp-
 admin/options-media.php
 setting page to allow users to opt out of it.

 I'm proposing a feature plugin first, so users can test this feature. I
 agree users need a way to opt out, although I'm not certain about the UI.

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


More information about the wp-trac mailing list