Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidFormat("Unexpected next IFD") #31

Open
evanw opened this issue Feb 28, 2023 · 3 comments
Open

InvalidFormat("Unexpected next IFD") #31

evanw opened this issue Feb 28, 2023 · 3 comments

Comments

@evanw
Copy link

evanw commented Feb 28, 2023

I have a JPEG image generated by a FLIR camera:

I traced through this library and it looks like the child IFD for Tag::GPSInfoIFDPointer has a next_ifd_offset of -1 (i.e. 0xFF_FF_FF_FF) instead of 0, which causes this library to fail with InvalidFormat("Unexpected next IFD").

The file is able to be parsed using exiftool. I traced through its Perl code and it seems like exiftool only parses the next IFD if the tag is known to have a next IFD. So maybe it's safe to just ignore the next IFD offset for child IFDs instead of validating the offset? That would allow this library to read EXIF metadata from files like this one. What do you think?

@kamadak
Copy link
Owner

kamadak commented Mar 1, 2023

Your analysis is correct. I am adding a more general "recovery from error" mode to the version 0.6 of this library.

@gzsombor
Copy link

gzsombor commented Jul 4, 2023

I've noticed, that someone already hacked a solution for this problem : vabock@76ee369
This solved my similar problem, maybe you can merge this fix, and release the library. What do you think?

@kamadak
Copy link
Owner

kamadak commented Sep 28, 2024

The file can be read with Reader::continue_on_error enabled, which was added in 710c1a3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants