- utility.go: Add GetExifData() to return flat tags and extra data and
to allow guessing of tags for misplaced IFDs.
- exif-read-tool/main.go: Implement tag guessing
- This resulted in the lookup table having unique entries, and therefore
no longer needing its values to be slices. We are going to fix this.
It is not a backwards-compatible change, but this is a fairly internal
internal functionality.
- Add simple accessors to determine if a thumbnail offset or size.
We were not qualifying our thumbnail tag checks with the IFD that
thumbnails are supposed to live in, and were trying to parse the tags
that happen to share the same tag-IDs as thumbnails.
Fixes #dsoprea/go-jpeg-image-structure/issues/10
We now keep track of the further offset that we have accessed (though
not necessarily the furthest offset of data that is unparseable by us).
It sometimes supports debugging efforts to have a ballpark idea of how
much EXIF data there is, rather than just "from the signature to the
end of the file" or however big the EXIF container is in the enclosing
image format. The latter can be buggy or ambiguous.
We've encountered a malformed user-comments value in an image from a
Canon EOS 5D Mark II.
2020/05/02 16:28:58 exifjpeg.ifd: [DEBUG] Parsing IFD [IFD/Exif] (0) at offset (0102).
2020/05/02 16:28:58 exifjpeg.ifd: [DEBUG] Current IFD tag-count: (33)
2020/05/02 16:28:58 main.main: [WARNING] Skipping unparseable undefined tag: [IFD/Exif] (9286)
2020/05/02 16:28:58 exifjpeg.ifd: [DEBUG] Descending to IFD [IFD/Exif/Iop].
2020/05/02 16:28:58 exifjpeg.ifd: [DEBUG] Parsing IFD [IFD/Exif/Iop] (0) at offset (a164).
Fixes#33