Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 258
Robusto Avatar asked Feb 01 '12 14:02

Robusto


People also ask

How do I make Chrome open new tabs with pictures?

Simply hold the ctrl and the alt/option key and left click on the image you would like to open in a new tab. The image will open in a new tab next to the one you are currently using Ecosia with. Right click on the image and choose "open image in new tab".

How do I force files to open in a new tab instead of download to my computer?

To make certain file types OPEN on your computer, instead of Chrome Downloading... You have to download the file type once, then right after that download, look at the status bar at the bottom of the browser. Click the arrow next to that file and choose "always open files of this type". DONE.

How do I make Chrome open images instead of downloading?

When you click on the three small lines dots (tools icon), you'll see a dropdown box appear. Click on "Settings" and you'll see a new page pop up in your Chrome browser window. Scroll down to Advanced Settings, click Downloads, and clear your Auto Open options.


3 Answers

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.

like image 175
Tom Clift Avatar answered Nov 10 '22 03:11

Tom Clift


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

like image 43
kriegaex Avatar answered Nov 10 '22 01:11

kriegaex


You can use the Chrome extension Undisposition to achieve this.

like image 30
David Salamon Avatar answered Nov 10 '22 03:11

David Salamon