exifr icon indicating copy to clipboard operation
exifr copied to clipboard

Issue reading APP1 data

Open BossensM opened this issue 4 years ago • 3 comments

Hi Mike,

When trying to parse the Exif of the attached image, a lot of the data is missing, such as very standard fields like ImageWidth and Height.

If you parse it using http://exif.regex.info/exif.cgi you can see a whole APP1 section is being missed in the parsing.

exampleexif

BossensM avatar Jul 16 '19 20:07 BossensM

Hello. thanks for checking in.

This is a strange case. I took a quick look at it and it's not that there would be more unread values. We're correctly reading all of them - 9 for ifd0, 6 for exif, 7 for gps image

XMP is also marked as APP1 (more info here) and exifr can get you the XMP as an XML string (we're not parsing XML because there are many more libraries for that). image

But I know that's not what you're talking about. This more like me posting notes to myself here :D

But anyway, then there's the other APP1 section that doesn't get read. I think you were referring to this one. image

BTW1: I couldn't find image width and height in that jeffrey's parser either, only the Raw Thermal Image Width in APP1

I'll have to look into it. Thought i don't know when will I have the time.

MikeKovarik avatar Jul 17 '19 08:07 MikeKovarik

Hi Mike ! Indeed I was referring to the other APP1 section at the end. Would be great if you could look at it or give some clues on where I could look.

BossensM avatar Jul 18 '19 16:07 BossensM

Hi. I'll be gone for two weeks or so but it'd be great if you'd like to look into it.

It appears to be a 3rd party extension by flir. I'm a bit confused why it's an app1 and not something like app20. It can be seen at the third screenshot where red marks the start of the app1 segment (FE E1). Except it's not followed by the standard "EXIF" signature but "FLIR".

You can use findAppSegment with various offsets in a loop and parse through the whole file to find all the segments. second arg is 1 for app1, third argument (condition) will have to check if there's the FLIR signature. Or make it truthy to get all segments. Fourth argument is a callback which you can use to modify output of the findAppSegment. I just now added fifth argument - offset - for you but that's the most I can do right now from a phone.

I suppose the data has the same structure as standard app1 so after that I think you can plug that segment into existing methods.

Good luck

MikeKovarik avatar Jul 18 '19 17:07 MikeKovarik