Open eicm opened 8 years ago
We are properly reading the tag and its corresponding type/length. The LensModel tag, for example, identifies it as a String of 70 bytes. However, we are getting the offset wrong at some point.
ExifTool properly extracts this data. Using ExifTool's -htmldump
option, I see there is a negative base offset, which we don't identify. I'm still trying to determine where this offset comes from. Subtracting that offset from our identified tag value offset properly identifies the lens model.
This data was extracted from the provided image (IMG_1782...). ExifTool displays the actual offset as being 0x0e52 (3666), which is 30 bytes off if you jump to that index in HexFiend or another Hex editor. The 30 bytes represent the offset to the beginning of the TIFF file.
Unsure of where the -164 base offset comes from.
This issue relates to a special case with Canon Makernotes. ExifTool actually has a dedicated option for fixing this. According to ExifTool, it occurs when the TIFF footer has the original offset.
exiftool -fixBase FILE_PATH
There are various special case rules for different makernote offset roots. Seems like we need another here.
The changes made in #136 now reads the canon maker note but it doesn't return the correct value. For example for the linked pictures it returns 0 for lens type and empty string for lens model: IMG_1782 (Medium).JPG.zip piano.006.zip