yigolden / TiffLibrary

C# library for decoding and encoding Tag Image File Format (TIFF) files.
MIT License
58 stars 16 forks source link

Files with odd IFD offsets #5

Closed csboling closed 3 years ago

csboling commented 3 years ago

The TIFF spec is unambiguous that IFD offsets shall be word-aligned, and TiffLibrary currently throws InvalidDataException when this is not the case. In practice however, many files in the wild violate this requirement, and most software can handle these files. As far as I can tell the decoder does not rely on this assumption and decodes such files fine if the checks for this (here and here) are removed. An option like "strict mode" for rejecting such files might allow for detecting spec violations while still being able to open files with this common spec noncompliance.

Some brief discussion here, archived from the libtiff mailing list from 2005.

yigolden commented 3 years ago

Thanks for finding this! The restriction was removed in v0.5.263.