Open evanw opened 1 year ago
Your analysis is correct. I am adding a more general "recovery from error" mode to the version 0.6 of this library.
I've noticed, that someone already hacked a solution for this problem : https://github.com/vabock/exif-rs/commit/76ee369bf4766af200679f17e216dfda51a262e0 This solved my similar problem, maybe you can merge this fix, and release the library. What do you think?
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 anext_ifd_offset
of -1 (i.e.0xFF_FF_FF_FF
) instead of 0, which causes this library to fail withInvalidFormat("Unexpected next IFD")
.The file is able to be parsed using
exiftool
. I traced through its Perl code and it seems likeexiftool
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?