2017.02.06 20:43 "[Tiff] Qs about support for more than 2^16 IFDs and writing performance", by Dinesh Iyer

2017.02.06 20:43 "[Tiff] Qs about support for more than 2^16 IFDs and writing performance", by Dinesh Iyer

Hi everyone,

I am developing an application that uses libTIFF for reading/writing TIFF files and I have the following questions about libTIFF. I apologize in advance if these questions have been asked but I could not find answers to them in the archive.

  1. I noticed that libTIFF does not support reading images from TIFF files as IFD's greater than 65535. The TIFF specification does not appear to impose such a limit but libTIFF does. I have a few clients who have 100,000 image TIFF stacks that they would like to be able to read.
  2. I noticed that libTIFF does appear to support writing > 65536 images into a TIFF file. Is this the expected behaviour or an over-sight?
  3. Lastly, when i tested writing a large number of images into a TIFF file, I found that the performance was very slow. It took ~2.5 hrs to write 66200 images, each of size just 64x64. I came across this github post: https://github.com/escabe/libtiff/commit/58b4c3ba4478987ecfe1e793b9d925e59eecfa36
  4. about why the performance is poor and a possible fix for this. Is this patch recommended?
  5. Are there plans to limit the 65536 IFD restriction for TIFF files and also improve the writing performance anytime soon? Or is the recommendation to patch my local copy of the TIFF library?

Regards,
Dinesh