Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExifTool trips over SHORT-typed StripOffsets values in TIFF files #52

Closed
marhop opened this issue Jun 24, 2020 · 4 comments
Closed

ExifTool trips over SHORT-typed StripOffsets values in TIFF files #52

marhop opened this issue Jun 24, 2020 · 4 comments

Comments

@marhop
Copy link

marhop commented Jun 24, 2020

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 and exiftool -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

@boardhead
Copy link
Contributor

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

@boardhead
Copy link
Contributor

This should be fixed in version 12.01 (just released)

Thanks for this report!

@marhop
Copy link
Author

marhop commented Jun 24, 2020

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

@boardhead
Copy link
Contributor

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants