[wp-trac] [WordPress Trac] #35725: Add WebP support.

WordPress Trac noreply at wordpress.org
Thu Mar 11 23:45:12 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 2nd-opinion needs-testing  |     Focuses:
  has-unit-tests                                 |
-------------------------------------------------+-------------------------

Comment (by adamsilverstein):

 [attachment:"35725.8.diff"] Cleans things up a bit and fixes phpcs errors.


 > Hmmm. As I understood it, you wanted to replace the original JPEG source
 with a WebP image. That was why i felt it was necessary to remind you of
 the issues with WebP. If your plan is to keep and use the source image for
 normal use, but replace smaller preview files with WebP versions, I don't
 see any problems.

 @atjn - Right, we would use this approach only for the "downsized" image
 formats WordPress creates when you upload an image (we would keep the
 original source image). ''I'm trying to explore what the best approach for
 most users is'' here, of course WordPress will let users opt out of any
 new behavior, and we will be sure to document how to do that.

 > The reason I mentioned JPEG XL, is if you replace the source with a WebP
 image now, and then release a new version in a year that replaces the
 source with JPEG XL, you will have to make a conversion between two
 different encoding styles twice, which is bad for retaining quality. That
 could be avoided if you design it with JPEG XL in mind from the start.

 WordPress will always keep the source uploaded image, then resize the
 image to the sizes we need for display.

 > This feature is not supported in WebP. It is supported in JPEG XL. There
 are other similar issues,

 I'm curious to hear more about any specific issues I should watch out for.

 Can you open a separate ticket to consider JPEG XL support? I'm also
 interesting in adding support for AVIF!

 > Hi, I'm from the webp team. If you are both resizing and converting to
 webp, there is no reason not to use webp. Webp should definitely provide a
 benefit over jpeg (smaller size for similar visual quality).

 @marylauc thank you for lending your expertise here. WordPress always
 saves the original uploaded image and the conversion from jpg to WebP
 would only occur during the downsizing of the large image to smaller
 sizes. Given the compression size benefits of WebP this seems like a
 promising approach.

 One follow up WebP question I have relates to the resources (CPU/memory)
 required to compress WebP images compared to jpeg images. The default jpeg
 quality settings WordPress uses have been tuned to meet the needs of most
 hosts and I want to better understand the impact launching this feature
 would have on hosts. Do you have any data on that?

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


More information about the wp-trac mailing list