Index: imagepicker.upload.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/imagepicker/imagepicker.upload.inc,v retrieving revision 1.3 diff -u -p -r1.3 imagepicker.upload.inc --- imagepicker.upload.inc 28 Aug 2008 21:25:20 -0000 1.3 +++ imagepicker.upload.inc 14 Sep 2009 11:56:40 -0000 @@ -219,15 +219,17 @@ function imagepicker_copy_uploaded_file( function imagepicker_get_uploaded_file_extension($name) { switch ($_FILES['files']['type'][$name]) { + // For some reason Internet Explorer 7 and later decides to give us + // non-standard MIME types for jpg and png files, this is supposedly + // for 'backwards compatibility'. For more details see: + // http://msdn.microsoft.com/en-us/library/ms775147(VS.85).aspx#_replace + + // Non-standard MIME type: case 'image/pjpeg': - // "What genius at microsoft decided to rename the mime type for jpgs?" - // Thats a nice phrase I have found about this mime type :) Wonder what - // am I talking about? Try to upload some type of jpg image via IE7. - // Don't know if it's the same with IE6, but IE7 might give you a mime - // type of image/pjpeg. So lets just treat this 'progressive jpg' as a - // normal jpg image. case 'image/jpeg': $fileext = '.jpg'; break; case 'image/gif': $fileext = '.gif'; break; + // Non-standard MIME type: + case 'image/x-png': case 'image/png': $fileext = '.png'; break; default: $fileext = ''; }