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 19:49 "[Tiff] error reading linearRaw subIFD from a TIFF file with libtiff built with libjpeg-turbo?", by Ellen Johnson

Hi libtiff developers!

We're now building libtiff v4.6.0 with libjpeg-turbo (instead of libjpeg v6b).

Many thanks to Bob F. for his previous help with modifying libtiff/configure to allow us to build with our modified libjpeg-turbo shared library prefix!

But with our libtiff v4.6.0 built with libjpeg-turbo, I'm now getting an error in our MATLAB imread function when reading a "linearRaw" subImage from one of our TIFF test files which is a linear DNG file. This does not error with libtiff 4.6.0 built with libjpeg v6b.

I'm not a linearDNG expert, but here's the overview of the file:

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.

Any help would be appreciated.

Thank you!

ellen