Page MenuHomePhabricator

thumbimages of webp images should be in webp format instead of png
Open, LowPublicFeature

Description

Steps to replicate the issue (include links if applicable):

  • click on one of the thumb links of any webp image

What happens?:

a png thumb file is displayed

What should have happened instead?:

a webp thumb file is displayed

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Aklapper changed the task status from Open to Stalled.Jun 8 2023, 3:08 PM

Hi @C.Suthorn, unfortunately this Wikimedia Phabricator task lacks some information.
If you have time and can still reproduce the situation: Please add a more complete description to this task. That should be

  • a clear and complete list of exact steps to reproduce the situation, step by step, so that nobody needs to guess or interpret how you performed each step,
  • what happens after performing these steps to reproduce,
  • what you expected to happen instead,
  • a full link to a web address where the issue can be seen,
  • the web browser(s) and web browser version(s) that you tested.

A good description should allow any other person to follow these steps (without having to interpret steps) and see the same results. Problems that others can reproduce can get fixed faster. Thanks.

This applies to all 29975 webp files at commons. Use mediasearch to choose any of them. On the file description page hover the mouse over the thumb download links and it will show a download url ending in ".webp.png" (and it is really silly to generate a png thumb from a png file. the webp will be smaller).

Aklapper changed the subtype of this task from "Bug Report" to "Feature Request".Jun 10 2023, 9:49 AM

Please include such steps. So I have to go to https://commons.wikimedia.org/wiki/Special:MediaSearch?type=image to find something like https://commons.wikimedia.org/wiki/File:Johnrogershousemay2020.webp (the first one I tried had no thumb images). Please always include links in the future so other people save time - thanks.

I'd say this is not a bug as there is no code behaving wrongly. It's a feature request as code to handle this likely does not exist...

Aklapper renamed this task from thumbimages of webp images are png files instead of webp to thumbimages of webp images should be in webp format instead of png.Jun 10 2023, 9:50 AM
Aklapper changed the task status from Stalled to Open.
Aklapper triaged this task as Low priority.
Aklapper edited projects, added Thumbor; removed MediaWiki-File-management.

See also T27611 for previous discussion on this topic.

In my testing, webp previews are not visible at all in the uploader. It looks like webp needed to be added to the list of content types the javascript handles, I've made that change here: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/928999/

TheDJ subscribed.

This ticket lacks argumentation. There is no case provided for why a webp preview should be provided.

Even if there were argumentation, almost all our thumbnails are either png or jpg. Webp optimized thumbnails are conditionally used when performance benefits from it and your browser supports it. I see no reason why webp and only webp should use webp thumbnails and other thumbnails are not taking into consideration.

Bawolff subscribed.

I'm going to boldly re-open this for further discussion

I was under the impression that we would dynamically send webp thumbnails when the accept: image/webp header was present, but that seems not to be the case, at least not with the files I tried

I think the argument goes:

  • All browsers that matter (If recent proposals go through, i think this will include even all grade C browsers) support webp
  • webp images often contain photographic data which compress very poorly in PNG format resulting in unnecessarily large thumbnails and a bad user experience
  • This would be fine if we were using content-negotation, but it seems like we are not (At least when I was testing)
  • Conclusion: webp thumbnails of webp files would give a better user experience when using this format given how it is usually used. Failing that, perhaps using JPG thumbnails for lossy webp with no transparency but PNG for other types might make sense

We might also want to reconsider if we want the must render flag on. It made sense when this was first added, but now that so many browsers support webp, we maybe don't want that flag on so the original asset is used when appropriate (possibly would also be helpful for animation).

I don't think this is an urgent issue by any means, just that we might want to reconsider this now that webp support is essentially universal.

I was under the impression that we would dynamically send webp thumbnails when the accept: image/webp header was present

Only for the top x percent of most requested thumbnails (its a caching layer optimization)

Global webp browser support is currently 96%
Do we know if something like kiwix can handle webp thumbnails ?

So the argumentation is:

  • almost all browsers we will support, support webp
  • png thumbnailing is worse than webp thumbnailing of webp resources
  • webp animations might work as thumbnails (untested)
  • lossy webp should not be using png anyways

We imply:

  • it is ok to serve a broken thumbnail to the few browsers that do not support webp
  • users that download webp thumbnails will not prefer png or jpg downloads (this used to be a problem due to lack of support in programs that were not browsers/phones etc, like image editing programs, whatsapp, instagram, as well as the previews for image cards of these platform. This might have changed a lot in the last couple of years).

Tested: whatsapp still doesn't support webp, and when you download a webp on iOS, it will auto convert it to jpeg.

Hmm, i was going by caniuse saying that IE11 was the newest browser that didn't support it, which based on wikitech-l is soon to be grade X. I think thumbs not working in a grade X browser would be reasonable, but you raise a good point about the broader ecosystem.

Maybe that leaves potentially using jpeg for thumbnails if it seems like the image would be well suited to it (lossy & no transparency). Not sure how viable it is to have the thumb format change based on image metadata.

Func subscribed.

See also T27611 for previous discussion on this topic.

I actually want to implement this as a core feature, see T366422.