metadata-extractor icon indicating copy to clipboard operation
metadata-extractor copied to clipboard

Not returning the correct values on Canon Makernote

Open eicm opened this issue 8 years ago • 3 comments

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

eicm avatar Jan 06 '16 19:01 eicm

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.

screen shot 2019-01-11 at 11 45 45 am

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.

payton avatar Jan 11 '19 17:01 payton

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

payton avatar Jan 11 '19 18:01 payton

There are various special case rules for different makernote offset roots. Seems like we need another here.

drewnoakes avatar Feb 14 '19 21:02 drewnoakes