Project

General

Profile

Actions

Patch #3534

closed

Mask image/x-png as image/png

Patch #3534: Mask image/x-png as image/png

Added by Sijmen Mulder over 17 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Attachments
Target version:
-

Description

Internet Explorer uploads PNG files with content type image/x-png, while the official content type is image/png. This is no big deal but Google Chrome doesn't interpret image/x-png as a PNG image and downloads it as if it were an octet stream.

A proposed patch is attached. I've modified the attachments controller to report image/x-png as image/png when serving attachments so that Chrome correctly shows the image inline.

This code could also have gone into the upload part, but I felt it was a bad idea to modify the database for this. There's a test included but I couldn't easily get the tests to run so it is untested.

Based on trunk r2792.


Files

pngtype.diff (2.25 KB) pngtype.diff Proposed patch Sijmen Mulder, 2009-06-24 11:16

Updated by Toshi MARUYAMA over 15 years ago Actions #1

  • Status changed from New to Closed

I can see inline image in Google Chrome 11.0.696.71.

Updated by Rodrigo Rosenfeld Rosas almost 14 years ago Actions #2

I can confirm this bug and it is still present. I also didn't understand why it didn't happen in my local Redmine instance but it happened on production but now I see that the reason is that IE8 is being used by the reporter, thanks!

Updated by Toshi MARUYAMA about 13 years ago Actions #3

  • Status changed from Closed to Reopened

Updated by Toshi MARUYAMA about 13 years ago Actions #4

Reopen request #14856.

Updated by Rodrigo Rosenfeld Rosas about 13 years ago Actions #5

To reproduce this, just attach a PNG image using IE8 and try to click on it on Chrome and it will ask you to download it instead of displaying it.

Updated by Go MAEDA about 11 years ago Actions #6

  • Status changed from Reopened to Closed

No problem in Chrome 45.0.2454.101. Chrome now supports image/x-png.
https://codereview.chromium.org/264043018

Actions

Also available in: PDF Atom