Chrome downloads PNG image links. I want them to open for viewing in a new tab. How do I make Chrome do that?

Google ChromeFile IoPngMime Types

Google Chrome Problem Overview


When I click on an image link right now, Chrome downloads the image instead of opening it.

Even if I right-click and select Open link in new tab Chrome still downloads the image, and I have to go through the extra steps of opening the file for viewing manually.

This feels like a mime-type issue to me, but why would Chrome not recognize "image/png" as a valid mime-type for viewing? All PNG images display just fine in an HTML page.

NOTE: This only happens for PNG images.

Google Chrome Solutions


Solution 1 - Google Chrome

The web server is probably serving the image using the image/x-png MIME type. Chrome http://code.google.com/p/chromium/issues/detail?id=25293">does not recognise this as an image (as of August 2012 February 2013), hence offers the file as a download.

image/x-png is a legacy MIME type from the days before it http://www.iana.org/assignments/media-types/image/png">got its official name, image/png, in 1996. However, when Internet Explorer uploads an image it does so using image/x-png "http://msdn.microsoft.com/en-us/library/ms775147(v=vs.85).aspx#_replace">for backward compatibility". I believe this was the case up to IE8, and was "fixed" in IE9. If the web server does not correctly handle this (the web server should detect this non-standard MIME type and treat it as image/png), then it may serve up the client-provided MIME type to other users, including to Google Chrome. Additionally, some web sites will serve up all PNGs as image/x-png.

If you're the web developer you should detect incoming image/x-png and treat it as image-png (never serve up image/x-png).

If you're the user report it as a bug and see @kriegaex's answer for a workaround.

Solution 2 - Google Chrome

@Tom Clift is right, and here is my workaround for it: use Chrome extension Redirector and add a rule replacing the Content-Type header. That's it. :-)

Solution 3 - Google Chrome

You can use the Chrome extension Undisposition to achieve this.

Solution 4 - Google Chrome

When you right click on the image you need to select then 'Open image in new Tab' from the drop down and NOT 'Open link in new tab' this will then open the image in a new tab.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRobustoView Question on Stackoverflow
Solution 1 - Google ChromeTom CliftView Answer on Stackoverflow
Solution 2 - Google ChromekriegaexView Answer on Stackoverflow
Solution 3 - Google ChromeDavid SalamonView Answer on Stackoverflow
Solution 4 - Google ChromeSimon DaviesView Answer on Stackoverflow