2024.02.05 19:49 "[Tiff] error reading linearRaw subIFD from a TIFF file with libtiff built with libjpeg-turbo?", by Ellen Johnson

2024.02.05 20:28 "Re: [Tiff] error reading linearRaw subIFD from a TIFF file with libtiff built with libjpeg-turbo?", by Bob Friesenhahn

Our imread function successfully reads the main image and the second subIFD. But when reading the first subIFD, something goes awry – it ends up calling libtiff's TIFFReadTile function in tif_read.c, which then calls TIFFReadEncodedTile (also in tif_read.c). I haven't debugged further yet, but something fails during TIFFReadEncodedTile which results in our imread function give error that the file has no readable tiles.

I'm wondering if you know what may be going wrong here, and/or if there are any limitations with libtiff built with libjpeg-turbo that would cause problems reading a 16-bit linearRaw subIFD that is JPEG compressed.

Until libjpeg-turbo 2.1.5 (see https://github.com/libjpeg-turbo/libjpeg-turbo/releases), it was not possible to easily support 16-bit JPEG. Since that version, it is possible for one library to support 8, 12, and 16-bit JPEG.

Working properly with the above requires a libtiff which operates correctly with the "new" (re-purposed) API. This would likely mean that you need a recent libtiff, released since the new libjpeg-turbo features were added.

What libjpeg-turbo are you using, and how was it configured?

Bob

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