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

5

59

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.

Fungicide answered 1/2, 2012 at 14:45 Comment(10)
I use chrome a lot and arre you talking about wwhen you view an image on line like butterflyutopia.com/wall4.jpg then click on it the above happens, as nothing happens for me on click and I can open in anothe rtab, have you got an EG to show etcAmylose
@SimonDavies: That one opens for me, but it's a JPG. If I try to open a PNG, like one of the two images shown on this Adobe bug-tracking page, it downloads them instead.Fungicide
its cause its surrounded in a link tag, if you right click and select further down from the 'Open Link....' and choose 'Open image in new Tab' this should then do as it says.Amylose
@SimonDavies: That's one of the problems, as I mention in my 2nd paragraph. If I right-click and choose "open link in new tab" it starts to open the image in the new tab, then closes the new tab immediately and downloads the image instead.Fungicide
Thats why i said use the 'Open image in new Tab' that is a bit further down from 'open link in new tab', on the right click drop down, not 'open link in new tab' as you mentionedAmylose
@Simon: Ah, I've been clicking on the link, not the image, which is why I was not seeing that dialog. Thanks, this works. If you want to enter this as an answer, I'll accept it.Fungicide
I have similar problem. But in my case chrome opens png with Content-Type:image/png in Response headers and downloads png with Content-Type:image/x-png. I think that problem with associated mime types.Dar
@Tom Clift is right, and here is my workaround for it.Numerous
possible duplicate of How can I edit Chrome MIME type mappings?Hickson
This happens to me with i.e. twitter's jpegs where after I cancel their save a popup would appear and ask "File downloaded?" on which after clicking ok (and it's blocking) the tab would usually close. Changing the format param to png rather did help to not have it closeLop
I
24

The web server is probably serving the image using the image/x-png MIME type. Chrome 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 got its official name, image/png, in 1996. However, when Internet Explorer uploads an image it does so using image/x-png "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.

Issacissachar answered 10/8, 2012 at 4:6 Comment(1)
Ok. So this explains the problem. But where's the solution?Boole
N
15

@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. :-)

Numerous answered 2/9, 2012 at 13:21 Comment(2)
Replace that header with what?Aureole
Maybe you should just follow the link and read my other answer. ;-) There you can see the replacement rule for Redirector. Besides that, the accepted answer here also explains what needs to be replaced.Numerous
S
6

You can use the Chrome extension Undisposition to achieve this.

Sirkin answered 19/1, 2021 at 13:44 Comment(0)
M
1

In addition to @Tom Clift's response, also, check the Content-Disposition header in the server response. If the value is inline, the content will be opened in the browser, and if the value is attachment, the content will be saved to disk.

Martins answered 13/3, 2023 at 16:27 Comment(0)
A
-3

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.

Amylose answered 1/2, 2012 at 15:59 Comment(4)
You suggest to right-click on every image? This is not a solution.Dar
This option doesn't exist in the dev tools. There is only 'Open link in new tab'Oeo
When I right-click an IMAGE LINK, there is no option to "Open image in new tab" only "Open link in new tab" which wants to download the PNG file instead of displaying it. The option "open image in new tab" only appears for rendered images on the page, not for links to images.Aureole
This answer seems to misunderstand the issue. Often a site will show a scaled-down version of an image that is linked to a full-size version. When you click the image, Chrome will offer a download (bad) instead of showing the full-size image (good). If you do what this answer prescribes, Chrome will show the thumbnail version in a new tab, which probably won't help.Alphonsa

© 2022 - 2024 — McMap. All rights reserved.