Firefox is downloading all images as webp again
Categories
(Core :: Networking: HTTP, defect)
Tracking
()
People
(Reporter: moltres.facesits.justin.coolidge, Unassigned, NeedInfo)
References
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Steps to reproduce:
I am trying to download some jpg files that I need for class. I am giving a presentation on Argentina and ALL the images that I am trying to download are downloading in .webp format which PowerPoint CANNOT use!
you guys said that the issue was fixed (according to the bug report that I filed more than six months ago), but it is STILL happening! I looked in about:config and found that the line I was supposed to delete is still gone so that is NOT the issue!
I opened up https://trip101.com/article/traditional-food-in-argentina
Right clicked some of the food images to save them
Actual results:
Despite the fact that these are jpg files, Firefox is trying to save them as .webp files
Expected results:
Firefox should download these images as the image format that they are originally.
Comment 5•5 years ago
|
||
Hi,
I have managed to reproduce this issue on latest FF release (69.0.1), latest Beta 70.0b11 and latest Nightly build 71.0a1 (2019-10-03) using Windows 10 and Windows 7.
I will move this over to a component so developers can take a look over it. From comment 1 it seems this issue is related to bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1530887
Thanks.
Comment 6•5 years ago
|
||
Baku were you looking into the referenced bug, and if so could you weigh in on this one?
Comment 7•5 years ago
|
||
Anne, what do you think it should be the right Accept header for images?
So far firefox uses: image/webp,/
Chrome uses: image/webp,image/apng,image/,/*;q=0.8
I haven't checked safari.
Comment 8•5 years ago
|
||
Andrea, I don't think this is related to the Accept
header (if you think we should change things there, let's do that in a separate bug). Given that OP is using Windows, I suspect this is basically bug 1571247, but OP somehow got WEBP in their registry instead of JFIF.
Comment 9•5 years ago
|
||
Dupe of / related to bug 1526731?
Comment 10•5 years ago
|
||
Gijs, as far as I can tell the server here is not sending WEBP, as also mentioned in OP. (Downloading an image on macOS results in a JPG.) That's why that other bug seems more plausible to me.
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment 13•5 years ago
•
|
||
(In reply to :Gijs (he/him) from comment #12)
presumably imglib doesn't care about the content type and uses magic numbers instead or something, which is (presumably) why we display them despite the wrong content-type.
This behavior is defined in the mimesniff spec. We should determine the file extension based on the computed MIME type (image/png
in this case) instead of the supplied one when we save an image.
Comment 14•5 years ago
|
||
(In reply to Masatoshi Kimura [:emk] from comment #13)
(In reply to :Gijs (he/him) from comment #12)
presumably imglib doesn't care about the content type and uses magic numbers instead or something, which is (presumably) why we display them despite the wrong content-type.
This behavior is defined in the mimesniff spec. We should determine the file extension based on the computed MIME type (
image/png
in this case) instead of the supplied one when we save an image.
Is this computed mimetype currently exposed to (chrome) JS anywhere?
Comment 16•5 years ago
|
||
Valentin, you can probably answer comment 14 or know who can?
Comment 17•5 years ago
|
||
(In reply to :Gijs (he/him) from comment #14)
(In reply to Masatoshi Kimura [:emk] from comment #13)
(In reply to :Gijs (he/him) from comment #12)
presumably imglib doesn't care about the content type and uses magic numbers instead or something, which is (presumably) why we display them despite the wrong content-type.
This behavior is defined in the mimesniff spec. We should determine the file extension based on the computed MIME type (
image/png
in this case) instead of the supplied one when we save an image.Is this computed mimetype currently exposed to (chrome) JS anywhere?
I think you can get the sniffed mimeType from nsIChannel.contentType - we call the TypeSniffers when the LOAD_CALL_CONTENT_SNIFFERS
flag is set, which then sets the sniffed mime type as the contentType of the channel.
I hope this helps.
Comment 18•5 years ago
|
||
(In reply to Valentin Gosu [:valentin] (he/him) from comment #17)
(In reply to :Gijs (he/him) from comment #14)
(In reply to Masatoshi Kimura [:emk] from comment #13)
(In reply to :Gijs (he/him) from comment #12)
presumably imglib doesn't care about the content type and uses magic numbers instead or something, which is (presumably) why we display them despite the wrong content-type.
This behavior is defined in the mimesniff spec. We should determine the file extension based on the computed MIME type (
image/png
in this case) instead of the supplied one when we save an image.Is this computed mimetype currently exposed to (chrome) JS anywhere?
I think you can get the sniffed mimeType from nsIChannel.contentType - we call the TypeSniffers when the
LOAD_CALL_CONTENT_SNIFFERS
flag is set, which then sets the sniffed mime type as the contentType of the channel.
I hope this helps.
For all the images I've checked the result for this is image/webp
.
But also, all those images when downloaded (by right clicking the image + "save image as", or right clicking the image and then "view image" and then "save file", actually produce a file that file
identifies as a webp image, rather than a png or jpeg.
Can someone provide clear steps where they can show we're showing a jpeg or png image that we mistakenly download as a jpeg? (yes, I said in comment #12 that the server returns png - I now think I was wrong and despite the URL displayed (and the finalURI
on the channel) indicating "png", we do actually get webp content -- I'll mark the comment obsolete).
Comment 19•5 years ago
|
||
On macOS, Firefox Nightly:
- Visit https://trip101.com/article/traditional-food-in-argentina.
- Save the image under "1. Locro – traditional Argentinian stew".
- End up with a .JPG.
(Inspecting headers doesn't tell a different story.)
Comment 20•5 years ago
|
||
(In reply to Anne (:annevk) from comment #19)
On macOS, Firefox Nightly:
- Visit https://trip101.com/article/traditional-food-in-argentina.
- Save the image under "1. Locro – traditional Argentinian stew".
- End up with a .JPG.
(Inspecting headers doesn't tell a different story.)
Following these steps on a clean profile on today's nightly (using the context menu and "save image as") saves a webp for me, also on macOS...
Comment 21•5 years ago
|
||
Per discussion with Anne, it seems the use of jpg may depend on cookies. On a clean profile, the server sends us webp and we offer to save as webp. This is also what other webp-capable browsers do. If you need the images to be compatible with other programs you could use an extension to convert images when saving them.
Description
•