New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 854824 link

Starred by 3 users

Issue metadata

Status: ExternalDependency
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature



Sign in to add a comment

`Accept: image/webp` isn't specific enough

Reported by e...@cloudinary.com, Jun 20 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3451.0 Safari/537.36

Steps to reproduce the problem:
1. Send a freshly-encoded WebP to an older version of Chromium which sent an `Accept: image/webp` header along with its request
2. Some older Chromiums can’t decode some newer WebPs, so some clients end up getting resources that they can't decode

What is the expected behavior?
There should be enough information in the `Accept` header for servers to send clients resources that they can decode.

What went wrong?
Some clients get WebPs that they can't decode.

Did this work before? No 

Does this work in other browsers? Yes

Chrome version: 69.0.3451.0  Channel: n/a
OS Version: OS X 10.13.5
Flash Version: 

Since 2011, Chromium has advertised `Accept: image/webp`. And while that Accept header has stayed constant, the WebP bitstream has [evolved considerably](https://chromium.googlesource.com/webm/libwebp/+/master/NEWS); not all Chromiums support all WebPs.

This has caused [Cloudinary](https://cloudinary.com) a few problems. Currently, we must UA-sniff for Chromium 32+ in order to determine whether or not to send clients animated WebPs, instead of animated GIFs. And, frankly, we're not doing enough to ensure we only send other sorts of WebPs to end users who can decode them. Instead, we end up advising customers experiencing compatibility problems with, say, lossless WebPs, not to use the Cloudinary features which generate them them.

I've started a discussion about solutions to this problem here: https://discourse.wicg.io/t/more-specfic-mime-types-for-images/2852
 
Components: Internals>Media
Labels: -OS-Mac
This doesn't look Mac specific. Routing to Media.
Cc: jzern@chromium.org dalecur...@chromium.org urvang@chromium.org
Components: -Internals>Media Blink>Image
Labels: Needs-Triage-M69
Labels: Triaged-ET Needs-Feedback
Thanks for filing the issue!

@Reporter: If possible could you please provide sample test file/URL that reproduces the issue which helps us in further triaging it.

Thanks!

Comment 5 by f...@opera.com, Jun 21 2018

Labels: -Type-Bug Type-Feature
Status: ExternalDependency (was: Unconfirmed)

Comment 6 by f...@opera.com, Jun 21 2018

Labels: -Needs-Feedback -Hotlist-Interop

Comment 7 by jzern@chromium.org, Jun 21 2018

For the webp format we declared it stable with the 1.0.0 release though it had been since the addition of animation. We have no plans to further modify the format so this discussion might better be had about future formats. The AOMedia group is investigating a next-gen format currently. It might be good to join in that discussion, I can have someone reach to you if they haven't already.

For the versioned mime/type, I think you'd still be in the situation where you had to UA sniff for support across versions [1]. That also wouldn't address any implementation fixes or changes in the browser itself. Somewhat recently we changed the looping behavior for webp for instance [2].

[1] https://bugs.chromium.org/p/chromium/issues/detail?id=854824
[2] https://bugs.chromium.org/p/chromium/issues/detail?id=649264

Comment 8 by jzern@chromium.org, Jun 21 2018

Bad copy and paste in comment #7, sorry about that.

[1] https://developers.google.com/speed/webp/faq

Comment 9 by e...@cloudinary.com, Jun 21 2018

Re: jzern —

Even if the WebP format remains stable forevermore, the fact that there are older browsers out there requesting with `Accept: image/webp` when they can’t actually accept all WebPs makes this a problem for us when delivering WebPs, now.

If new Chromiums began broadcasting something that differentiated them from older Chromiums – for instance, `Accept: image/webp;codecs=libwebp1.0` – we (Cloudinary) could stop UA sniffing, and instead make decisions about whether or not to send animated, lossless, or transparency-containing WebPs based solely on the `Accept` header:

`Accept: image/webp;codecs=libwebp1.0.0` → we know that we can respond with animated/transparent/lossless WebPs
`Accept: image/webp` → we do not know that we can send anything other than a baseline lossy WebP. Use other formats for images that require animation/transparency/losslessness.

User-Agent sniffing is hard to do well – and getting harder to do at all [1]. Chromium making this change would:

1. establish a precedent for how to deal with moving-target formats, as you suggest (we would love to join those discussions re: AVIF! A mechanism like this could also help browsers/servers roll out support for older, never-universally-adopted things like arithmetically-coded-JPEGs [2].)
2. let us stop UA sniffing to work around issues with WebP, right now

---

Re: viswa.karala –

Consider the <img> tag here:

https://codepen.io/eeeps/pen/zaWbrv

This uses Cloudinary’s `f_auto` feature, which format-switches automatically, sending different clients different images (each according to its ability). So, if you load this page in Safari, you’ll get an animated gif; if you load it in Chrome 32+, you’ll get an animated WebP. Originally, *any* browser that sent `Accept: image/webp` would receive an animated WebP, but customers complained that older Android phones were getting broken images, so we had to start UA-sniffing in order to know when we could/could not trust that `Accept` header.

---

[1]: https://twitter.com/rmondello/status/943545865204989953
[2]: https://bugs.chromium.org/p/chromium/issues/detail?id=669501#c8

Comment 10 by jzern@chromium.org, Jun 22 2018

Cc: pkasting@chromium.org jaikk@chromium.org pascal.m...@gmail.com noel@chromium.org
> 2. let us stop UA sniffing to work around issues with WebP, right now

That's true at the cost of more modern chromiums M32-M70 being penalized unnecessarily for an even older set of browsers.

Extending the accept header comes at a cost of request size, which Chrome has been sensitive to in the past. And as said pinning to a decoder version doesn't eliminate issues in the wrapper implementation. I think there are lessons in webp deployment that can be applied in the future, but any changes to existing behavior would require input from others, a few of which I'm including on cc.
Here's how we're looking at the costs:

Broken images
	= completely unnacceptable, avoid at all costs

Sending an (e.g., 30MB) animated gif when a (e.g. 15MB) lossy animated WebP would have worked
	= very bad

5? 10? extra bytes on every image HTTP request
	= insignificant

We want a solution here that lets us confidently NEVER send anyone broken images, and minimizes the number of times we send people megabytes of extra data.

You're correct that the change we're suggesting would lead to Chromes 33-70 suffering with a lot of extra data. That's a cost we're willing to pay to be certian that we're never ever sending anyone broken images, and that every browser going forward that can handle aWebP, will get it.

We're also weighing that cost against the assumption that the UA sniffing that we're doing now is  excluding a number of non-Chrome clients from those gains... We'll start gathering some data internally to see how many browsers that `Accept: image/webp` are not getting WebPs at all because they don't fit the UA filters we've attatched here.

As WebP support grows (e.g., Edge is about to adopt it), UA sniffing around this issue is going to get much harder. We're advocating for this issue to be addressed now. 

Just drawing attention to Mark Nottingham's suggestion to use a new subtype to differentiate, over on the WICG thread:

https://discourse.wicg.io/t/more-specfic-mime-types-for-images/2852/4?u=eeeps


Sign in to add a comment