drewnoakes / metadata-extractor

Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Apache License 2.0
2.55k stars 479 forks source link

Fix reading arrays of Float64 in TIFF files #548

Closed fclof closed 3 years ago

fclof commented 3 years ago

Double64 should take 8 bytes, instead of 4.

I found this bug when I tried to read tags from a geotiff.

The original data was 7B 14 AE 47 E1 7A 84 3F ----- 0.01 index 0 - 7 7B 14 AE 47 E1 7A 84 3F ----- 0.01 index 8 - 15 00 00 00 00 00 00 00 00 ----- 0 index 16 - 23

but metadata-extractor read it like this: 7B 14 AE 47 E1 7A 84 3F ------- index 0 - 7 E1 7A 84 3F 7B 14 AE 47 ------- index 4 - 11 [should be 8 - 15] 7B 14 AE 47 E1 7A 84 3F ------- index 8 - 15 [should be 16 - 23]

drewnoakes commented 3 years ago

Nice find!

We have the same bug in the C# version too it seems:

https://github.com/drewnoakes/metadata-extractor-dotnet/blob/51169eb3ac09bd78f310147e44069fc0af6ec229/MetadataExtractor/Formats/Tiff/TiffReader.cs#L304