2021.05.06 02:09 "[Tiff] Use and implementation of Deflate vs. AdobeDeflate in libtiff", by David Ryskalczyk

2021.05.06 02:09 "[Tiff] Use and implementation of Deflate vs. AdobeDeflate in libtiff", by David Ryskalczyk

All,

I was working on fixing a bug in a software tool that uses libtiff and noticed that it was erroneously using the Deflate (32946 or 0x80b2) compression identifier instead of AdobeDeflate (8).

The Adobe TIFF documentation at https://www.adobe.io/content/dam/udp/en/open/standards/tiff/TIFFphotoshop.pdf indicates, on page 3, that both of these compression identifiers use the same algorithm. However, looking over the libtiff code, there are places where Deflate and AdobeDeflate differ in behavior. If this documentation is correct, that is not preferred behavior. Additionally, software that uses alternate TIFF reading code may have issues with the legacy (32946) Deflate identifier.

Would it make sense to update libtiff so that it no longer writes the legacy libtiff identifier, but can still read files with it? Or would a different approach be preferred? It seems that it is currently too easy for someone using the library to write files with the legacy compression identifier.

David