2021.06.18 16:10 "Re: [Tiff] IJG libjpeg-9d breaks libtiff JPEG-in-TIFF compression", by Guido Vollbeding
Yes, I noticed the special requirements due to the tile/strip mode.
Regarding being dependent on specific behavior of libjpeg 9d on the decoding side, we cannot do this. libtiff is typically built against other implementations of libjpeg (libjpeg-turbo being quite popular).
Again: It is now general consensus for JPEG decoders to work with undefined Huffman tables for compatibility with Motion-JPEG streams, even those fake implementations!
We have also to output something that is conformant with the TIFFTechNote2 and any library (possibly not even using libtiff) implementing it should be able to decode what libtiff outputs. This is all about interoperability: there isn't much place for innovation, or it must carefully fits into the degree of freedoms permitted by the specification.
The specification is not compatible with Motion-JPEG streams. The recent JPEG decoders, even the fake ones, ARE compatible with Motion-JPEG streams.
It is all about compatibility and consistency!
I'd be curious to hear your suggestion for a prettier alternative to my workaround though.
In a moment... Have you tried the unmodified code with libjpeg 9d compression and decompression? Does it work?
Editor's note: This mail was not originally archived, and has been reconstructed from quotes.