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

WordPress Trac noreply at wordpress.org
Thu Mar 18 18:16: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 needs-testing has-unit-    |     Focuses:
  tests needs-dev-note dev-feedback              |
-------------------------------------------------+-------------------------

Comment (by blobfolio):

 Replying to [comment:110 atjn]:
 > Replying to [comment:106 adamsilverstein]:
 > > > I still think that numbers are not high enough to force it's use.
 https://www.caniuse.com/webp
 > >
 > > @spacedmonkey For unsupported browsers, one possibility is to use an
 async [https://github.com/Modernizr/Modernizr/blob/master/feature-
 detects/img/webp.js capabilities check] then lazy load a
 [https://github.com/chase-moskal/webp-hero shim] if required. We may want
 to consider the caniuse numbers with a little salt, they
 [https://twitter.com/_developit/status/1367158704219504641 may not be
 accurate].
 >
 > Usage statistics should definitely be taken with some skepticism, but
 the criticism you're linking to is objectively wrong (see the comments
 from Statcounter). I think Jason misunderstood how the service works
 fundamentally. In my experience, Statcounter is pretty solid.

 Don't forget that iOS doesn't actually support rendering engines other
 than Safari's. Everyone with an old iPhone will be stuck without WebP
 support until they buy a new device regardless of the "browser" they use.

 Global usage stats are a good place to start, but don't really mean much
 when it comes to predicting the kinds of traffic any individual site might
 receive. There are still entire industries (insurance, government, non-
 profit, medical, etc.) requiring Internet Explorer compatibility.

 > Having a fallback to a browser shim for a few years sounds like a great
 idea to me.

 Testing for WebP compatibility (a la Modernizr) requires the ability to
 inject a data-uri image into the DOM. Sites with CSP restrictions
 prohibiting script-generated data: sources won't be able to execute the
 tests.

 Using `<picture>` is a lot more performant than any runtime-based decoding
 fallback, but would require sites still generate thumbs in the original
 format (and WebP thumbs secondarily). That's the main reason the original
 ticket avoided conversion. The original patches were limited to adding
 support for WebP images in their own right, not trying to take away steam
 from other formats.

 Whatever approach ends up being taken, it is important to allow sites to
 opt-out of any fallback/compatibility-testing functionality (in addition
 to being able to opt out of conversion).

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


More information about the wp-trac mailing list