.png file uploads fail

Jay Matwichuk - September 8, 2009 - 06:10
Project:Image Picker
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Sometimes, for some users, when trying to upload a .png file, I get an error that says something towards the effect of 'files must be .jpg or .png', yet the file is a .png file, with a .png extension.

I'm sorry I don't have more details, but this happened while I was showing a client the system, so I couldn't take screenshots or notes at the time. I converted the file to a .jpg, and it uploaded fine. Any ideas why this may be happening?

#1

hutch - September 8, 2009 - 09:12

When the browser sends an image up to the server it includes some metadata, in this case it should have sent type='image/png'
Apparently it sent something else, eg type='image/jpg' ;-(
Sometimes you get people who think that you can change an image's type by changing it's name, you reversed the process and it worked. Or something like that.

#2

Jay Matwichuk - September 10, 2009 - 01:31

In this case, I created the image myself in photoshop, and saved it as a .png file. It was then moved to a memory stick, and on to another computer, from where the upload was attempted. But there were no filetype or name conversions between that point, just media transfers.

If it happens again, I will upload the image here when it happens.

#3

Steven Jones - September 14, 2009 - 11:36

I can confirm this issue with IE, and image picker 1.4.

#4

Steven Jones - September 14, 2009 - 11:42

IE 8 sends:
'image/x-png'

#5

Steven Jones - September 14, 2009 - 12:10
Version:6.x-1.5» 6.x-2.x-dev
Priority:normal» critical
Status:active» needs review

Okay the issue is that IE7 and later does the whole funny mime type thing with JPGs and PNGs. Imagepicker handles JPGs but not the PNG issue. Find attached patches for:

CVS Branch Release File
DRUPAL-6--2 6.x-2.x imagepicker-571198-6--2.patch
HEAD 6.x-1.x imagepicker-571198-HEAD.patch
DRUPAL-5--2 5.x-2.x imagepicker-571198-5--2.patch

Marking critical as this issue is quite serious.

AttachmentSize
imagepicker-571198-HEAD.patch 1.5 KB
imagepicker-571198-6--2.patch 1.66 KB
imagepicker-571198-5--2.patch 1.69 KB

#6

hutch - September 14, 2009 - 13:31

Thank you for the patches, I will apply them to cvs shortly
M$Windows does it again ;-(

#7

hutch - September 14, 2009 - 14:00

png-x bug applied to imagepicker, there are new stable versions for D5 and D6 and the devs will catch up later.

#8

hutch - September 14, 2009 - 14:01
Priority:critical» normal
Status:needs review» fixed

#9

System Message - September 28, 2009 - 14:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.