Problem/Motivation
Image bandwidth would reduce by ~25%-34% with conversion to webp. See https://developers.google.com/speed/webp.
The lone holdout to webp support is older versions of Safari (see https://caniuse.com/webp). Safari supports webp, but OSX Catalina doesn't, at all, you get a broken image thing instead of a photo. Catalina will loose support later this fall, so we can start planning for this feature NOW so it will land in 10.1.
One datapoint is that the fermilab network is actively blocking Catalina installs - which is not a huge userbase but it does mean people are going to get forced off it altogether.
https://news.fnal.gov/2022/10/macos-catalina-v10-15-end-of-life-friday-o...)%20has%20reached%20its%20end,from%20accessing%20the%20Fermilab%20network
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Drupal core install profile shipped image styles now convert to webp, this will be effective for new installations. Site owners may want to consider adding a webp conversion step to their own image styles.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 3275557-12.patch | 12.32 KB | andypost |
| #12 | interdiff.txt | 293 bytes | andypost |
Comments
Comment #2
catchComment #3
catchComment #4
catchI think we can do this now that Catalina is out of support, but I've asked other committers what they think too.
Comment #5
catchNote that #3213491: Add fallback format support to responsive images would make OSX Catalina a non-issue, but I'm not sure we should block this issue on that one. It'll still be useful later on for AVIF and other formats.
Comment #6
catchComment #7
catchDiscussed this with @lauriii and he also thinks we should go ahead here despite Catalina - given it's been out of support since November, Apple's not supporting it so neither should we.
The core change won't prevent sites reverting back to png or using the contrib webp module with fallback support if they still want to, it's just making defaults (much) faster/smaller for everyone else.
Comment #8
catchUntagging now there's been a +1 from a front end framework manager, and looking at things like fermilab dropping support has also reassured me it should be fine. Also anecdotally I know one person who was still on OS Catalina last year, and I asked them last week if they still are, and they're not any more. We can't get proper usage data because Safari reports Big Sur as Catalina, but there's every other sign that people are getting off it.
Comment #9
andypostIt probably needs to CR and upgrade path but let;s start from all places I can find with
git grep 'png gif jpg jpeg'Comment #10
andypostProbably it makes sense to convert images in Demo umami from jpeg as each file becoming smaller more the 15KB
find . -type f -name "*.jpg" -exec sh -c 'convert "$1" "${1%.jpg}.webp"' _ {} \;Comment #11
andypostProbably duplicate #3282679: Allow user-uploaded WebP images everywhere in Drupal by default: image fields, media library, text editors
Comment #12
andypostfix cspell
Comment #13
smustgrave commentedChange looks good.
Would be nice to see this get into 10.2 early.
Comment #14
longwaveI searched for "jpeg", excluding tests and "webp", and found a few other places we might want to consider adding webp while we are here - I haven't checked any of these in detail and not sure it should be added, but we should at least consider these:
Comment #15
longwaveActually I see #3282679: Allow user-uploaded WebP images everywhere in Drupal by default: image fields, media library, text editors covers some of these.
Comment #16
catchI think it's worth leaving the image derivative issue (this one) and the upload issues separate, unless they really need to be combined - just to have less things to to worry about in each.
Comment #17
longwaveOK, let's just land this here, and leave the other one open to handle the remaining cases.
Comment #18
longwaveCommitted and pushed a87a72fa063 to 11.x (10.2.x). Thanks!
Comment #20
longwaveCrossposted with the bot.
Comment #21
catchAdded a release notes snippet, don't think there's anything else to mention so leaving a CR. Also tagging for 10.2.0 release highlights since this will be a nice performance improvement on new sites. Also not sure how many site admins actually know the webp option is in core.
Comment #23
adamsilverstein commentedGreat to see this merged into Drupal core!
I noticed that the Lighthouse Stack Pack for Drupal for the `modern-image-formats` audit point to this documentation : https://www.drupal.org/docs/core-modules-and-themes/core-modules/image-m... which makes no mention of WebP or how to enable modern image formats. Should we update the documentation here, or is there a better place we can link the Stack Pack message? Since the Stack Packs are open source we can proposes changes for the link or recommendation text directly on the repository.
Comment #24
ericdsd commentedEven if i've been waiting for real webp support for a long time, I sadly think doing so without fixing at least Add fallback format support to responsive images is not a really a news, as lot of old mac users cannot update their os (eg. lots of artists still use macbook pro 2012, not mentioning poor people). It means that doing this we'll collectively enforce Apples programmed obsolescence by providing massivelly degraded web experience for people not able to change their computer every 6 years as Apple now forces people to to). In a more general way we should provide a more robust out of the box fallback methods to ease adopting new images and video formats like avif.
Do you think there is a chance to see fallback issue embedded in 10.2 too ?
Comment #25
catchThis issue didn't actually add webp conversion to core's shipped image styles at all, just as an option for upload to image fields (which is fine, but not what the issue was originally for) I've opened #3406267: All core shipped image styles should include webp conversion to do that bit.
Comment #26
catchUntagging from 10.2.0 release highlights, hopefully we can get the follow-up into 10.3/11.x