When I add a png image, using the image module's image content-type node, it seems to upload fine since the files show up on the server. However, I get a blank page on upload and when I try to access the new image node. On upload, I get this error:
[Fri Jul 13 20:16:04 2007] [error] PHP Fatal error: Uncaught exception 'PelJpegInvalidMarkerException' with message 'Invalid marker found at offset 0: 0x89' in /home/flfn/www/drupal/sites/all/modules/exif/pel/PelJpeg.php:220\nStack trace:\n#0 /home/flfn/www/drupal/sites/all/modules/exif/pel/PelJpeg.php(315): PelJpeg->load(Object(PelDataWindow))\n#1 /home/flfn/www/drupal/sites/all/modules/exif/pel/PelJpeg.php(163): PelJpeg->loadFile('files//images/D...')\n#2 /home/flfn/www/drupal/sites/all/modules/exif/exif.module(44): PelJpeg->__construct('files//images/D...')\n#3 /home/flfn/www/drupal/modules/node/node.module(462): exif_nodeapi(Object(stdClass), 'view', NULL, NULL)\n#4 /home/flfn/www/drupal/sites/all/modules/og/og.module(1766): node_invoke_nodeapi(Object(stdClass), 'view', NULL, NULL)\n#5 /home/flfn/www/drupal/sites/all/modules/og/og.module(1690): og_node_view(Object(stdClass))\n#6 /home/flfn/www/drupal/sites/all/modules/og/og.module(1351): og_mail('Image', Object(stdClass))\n#7 /home/flfn/www/drupal/modules/node/node.module(462): og_nodeapi(Object(stdClass), 'insert' in /home/flfn/www/drupal/sites/all/modules/exif/pel/PelJpeg.php on line 220
It appears that this module breaks the image module when uploading a png file, which does not support exif data. The code should probably verify that the image is a jpeg before it tries to perform any exif-related queries.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | exif_png.patch | 788 bytes | david lesieur |
Comments
Comment #1
scott falconer commentedHere's what I did to fix this...
changed lines 43 through 48 to:
I'm not real good at php, so maybe this isn't the best way to go about it, but it at least fixes the problem.
Basically, it takes the first letter from the file extension, makes it upper case, and then checks if it's an uppercase 'J' or else breaks. It'll work if the file extension is jpeg Jpeg jpg jPg etc....
Comment #2
raintonr commentedThanks Scott. We were having the same problem, that fix works here too.
Comment #3
david lesieur commentedI'll try to review this soon. Thanks for the fix!
Comment #4
david lesieur commentedLooking at the first letter of the extension is not the most solid way to check for the file format... Here's the patch that I have committed instead.
Thanks for the help!
Comment #5
brasto commentedExcellent! A big thank you from brasto!
Comment #6
(not verified) commented