6

This is one of the most irritating behaviours I've ever experienced.

You retrieve a JPG file from the Web, but Chrome forces you to download it in WEBP format. Absurd conversion especially when it is not desired (and there are many, many reasons for this: wanting the exact original file, retrieving metadata, problems reusing the webp file in other software, etc).

Is there a way to disable this annoying behaviour?

example: https://www.predictiveanalyticstoday.com/wp-content/uploads/2016/09/Stardog.jpg

1
  • 1
    FYI, if I use Brave (a Chromium-based browser) to download that file, I get a JPG file and not a WEBP file. – galacticninja Sep 14 '19 at 9:06
3

You retrieve a JPG file from the Web, but Chrome forces you to download it in WEBP format.

Don't blame Chrome for this behavior. This behavior is implemented by the "Polish" image optimizer in CloudFlare, not by the browser.

There is no way to disable WebP support in Chrome; even if there were, it would not prevent web servers from delivering WebP images if they believe your browser would prefer them.

4
  • You are right, I can see the header cf-polished: qual=85, origFmt=jpeg, origSize=44781 content-disposition: inline; filename="....webp". Quite annoying that the original final cannot be downloaded. – user1156544 Jun 21 '19 at 21:43
  • Well, Chrome announces WebP support in its HTTP "Accept:" header, so maybe you could have an extension that modifies this header to remove image/webp? – user1686 Jun 21 '19 at 22:25
  • 1
    @grawity My experience has been that Cloudflare is pretty insistent about trying to deliver WebP. Last time I tried, modifying or omitting the Accept header had no effect. – user89623 Jun 21 '19 at 23:00
  • Oh so it means CF is doing the User-Agent nonsense then. Sigh – user1686 Jun 22 '19 at 7:17
9

Try putting a ? after the image location, then save.

Make http://example.com/image.png like this http://example.com/image.png? and CMD+S save (Mac) will save as the expected format.

3
  • 1
    Great workaround – user1156544 Jan 11 '20 at 14:08
  • Why does this work? – Edge Oct 22 '20 at 4:52
  • You might have to add some random text after the ? - the ? alone may not work. This random text will generally bypass CloudFlare/whoever's CDN/caching which has optimized as webp and instead download the original by sending a pull request to the origin server – Peter Kionga-Kamau Feb 27 at 0:46
0

The most versatile way is to use ModHeader to change your "Accept" request header to the value "image/avif,image/apng,image/svg+xml,image/,/*;q=0.8".

Any sites that are still serving WebP despite the Accept request header now missing acceptance for WebP can be tricked by modifying the User-Agent header. Again, ModHeader will be able to accomplish this, although that needs a bit more caution, because a lot of websites will serve entirely different content based on the User-Agent.

0

You can use curl to download it from the command line:

curl -O https://www.predictiveanalyticstoday.com/wp-content/uploads/2016/09/Stardog.jpg

It's available by default in OS X, Linux, and Windows 10. If you have an older version of Windows, you can install curl.

You can do the same with wget if you prefer:

wget https://www.predictiveanalyticstoday.com/wp-content/uploads/2016/09/Stardog.jpg

2
  • 1
    Windows already has native curl since version 1803, i.e. 3 years ago. And PowerShell already has all curl's capabilities – phuclv Mar 8 at 3:30
  • Thanks, I updated the answer. – Ian Dunn Mar 8 at 15:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.