ExifTool trips over SHORT-typed StripOffsets values in TIFF files
marhop opened this issue · comments
Hi,
ExifTool 12.00 seems to have a problem with StripOffsets pointers in TIFF files if they have type SHORT instead of LONG (both are permitted by the TIFF 6.0 spec).
Consider the attached files:
- stripoffsets-short-0.tif has three StripOffsets values of type SHORT (source)
- stripoffsets-long-0.tif is the same file with exactly one difference: the three StripOffsets values have type LONG
Writing some tag to these files (I used exiftool -ISO=42
) results in these files:
- stripoffsets-short-1.tif is damaged, it has three StripByteCounts values (
0 16448 8100
, first one is zero?!) but only two StripOffsets values (248 8348
); the file cannot be displayed by various viewers andexiftool -validate -warning -a
issues matching warnings:- Wrong number of values in IFD0 0x0111 StripOffsets
- Oversized IFD0 StripByteCounts (24548 bytes, but expected 24300)
- stripoffsets-long-1.tif is OK though
Any idea what's going wrong here?
Thanks,
Martin
Hi Martin,
Wow. This is serious. I guess that using 16-bit offsets is very rare or I would have seen this before.
I'll get on this right away.
- Phil
This should be fixed in version 12.01 (just released)
Thanks for this report!
Hi Phil,
This is awesome, how can you be so fast? It took me longer to find this bug than it took you to fix it. :-)
using 16-bit offsets is very rare
Agreed! This file is just a contrived example. I don't expect to see 16-bit offsets in many real-world files since these would have to be quite small.
As far as I'm concerned this issue may be closed now.
Cheers,
Martin
Great, thanks!