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

2021.05.06 10:45 "Re: [Tiff] Use and implementation of Deflate vs. AdobeDeflate in libtiff", by Even Rouault

Hi,

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.

My first reaction would be that it's an overlook. Each place where we test for COMPRESS_DEFLATE we should also test for COMPRESS_ADOBE_DEFLATE and vice versa. Could you issue a merge request fixing the mismatches you spotted?

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,

Would be a bit extreme, but we could emit a non-fatal warning (using TIFFWarningExt())

Even

http://www.spatialys.com
My software is free, but my time generally not.