Forum Moderators: coopster

Message Too Old, No Replies

exif_read_data error

Incorrect APP1 Exif Identifier Code

         

Nutter

3:47 am on Jun 30, 2006 (gmt 0)

10+ Year Member



I'm getting the error Incorrect APP1 Exif Identifier Code from a call to exif_read_data, but not always. It follows an ImageMagick convert to resize the image and then the exif_read_data function reads the converted file. I see on the ImageMagick forums that this can be caused by something not working correctly in the convert command. But I can't find anything else. I tried Googling for it and all I found were pages with that error :-)

Any thoughts?

Nutter

12:52 pm on Jun 30, 2006 (gmt 0)

10+ Year Member



I'm fairly sure the problem is coming from a buggy version of ImageMagick stripping out the EXIF data during a conversion.

Is there a way to check and see if an image has EXIF before calling exif_read_data, or to have it fill the array regardless and then I can check to see if the field I need is populated?

eeek

8:00 pm on Jun 30, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can try looking at the exif data in the converted image with jhead.

Nutter

9:00 pm on Jun 30, 2006 (gmt 0)

10+ Year Member



I'd prefer not to shell to another external program that the user may not have.

It turns out that the EXIF is still there but somehow got screwed up during the conversion - Photoshop can read it but IrfanView can't. I checked the variable array I loaded ($x = exif_read_data()) and the information was there, it just threw a warning while loading it. I threw an @ in front on the exif_read_data call and go from there.