2020.08.03 21:27 "[Tiff] Unable to read a large TIFF File (single image, one IFD, Strip image of size 2.6 GB) on Unix using TIFFClientOpen API", by Upanita Goswami

2020.08.03 21:27 "[Tiff] Unable to read a large TIFF File (single image, one IFD, Strip image of size 2.6 GB) on Unix using TIFFClientOpen API", by Upanita Goswami

Hi libTIFF group,

Thanks all for your suggestions on the previous issue. We were able to resolve our previous issue. It turned out to be a very silly issue on our part related to passing a char pointer to an anonymous temporary object of type std::string for the filename to TIFFClientOpen API. After fixing this most of our test cases are now working when we switch from TIFFOpen to TIFFClientOpen API.

We do see an issue reading a large TIFF image (2.6 GB, only one strip in the entire image and only one IFD) on Linux and MAC. In Windows, we are able to read the file.

In Windows, the progression of bytes read from the file is in this.(This is a trace log from the read callback (TIFFReadWriteProc) for a success scenario)

bytes_read = 8
bytes_read = 2
bytes_read = 192
bytes_read = 4
bytes_read = 6
bytes_read = 16
bytes_read = 48
bytes_read = 2637881541
<success>

In Linux, the progression of bytes read is different after a certain point compared to Windows and then fails with error ; 'TIFFFillStrip: Read error at scanline 4294967295; got 2263871488 bytes, expected 2637881541.'

bytes_read = 8
bytes_read = 2
bytes_read = 192
bytes_read = 4
bytes_read = 6
bytes_read = 16
bytes_read = 48
bytes_read = 1048576
bytes_read = 10485760
bytes_read = 104857600
bytes_read = 2147479552

'TIFFFillStrip: Read error at scanline 4294967295; got 2263871488 bytes, expected 2637881541.'

The part in yellow is bizarre and different than Windows. File size is 2637881818 (~2.6 GB). Also, we noticed that the callback to get size of the file (TIFFSizeProc) is invoked in Windows for large files like this one but not in Unix (not sure if this was an intentional implementation). Can you reproduce this for a similar sized single strip TIFF image in Linux? Our code is same in Windows and Unix.

Thanks,
Upanita