2017.05.11 17:35 "[Tiff] JPEG compressed RGB tiled TIFF with chroma subsampling", by Yakov Galka

2017.05.22 13:39 "Re: [Tiff] JPEG compressed RGB tiled TIFF with chroma subsampling", by Bob Friesenhahn

On Thu, May 11, 2017 at 11:48 PM, <jcupitt@gmail.com> wrote:

I don't think I've come across a reader which doesn't handle this case. Almost all jpeg-in-tiff files use this mode, so you really have to.

I take my words back. The only viewers that worked were mspaint and the windows photo viewer. IIPImage seems to have tried to support it but has a bug and fails. OpenCV imread fails. Pretty much every code that does not expect to handle this case *specifically* fails. Which I expect to be the majority of TIFF reading code in the wild.

There are many broken/incomplete TIFF readers "in the wild", particularly when one goes beyond "baseline" TIFF. JPEG compression is particularly an issue since its original specification was broken and Adobe's DRAFT TIFF Technical Note #2 (http://www.simplesystems.org/libtiff/TIFFTechNote2.html) should be followed instead.

I expect libTIFF to abstract those differences. It is not the only thing that libTIFF chooses to shift the responsibility onto the user of the library even though it could just as cheaply hide those pesky details. Another example would be the tile/strip discrepancy.

Libtiff does provide dummy/abstraction interfaces, but they do result in increased resource consumption, loss of performance, and sometimes loss of original image quality, compared with use of lower-level interfaces which deliver more directly into the using application's preferred internal storage format.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/