2005.08.02 22:39 "[Tiff] Unable to read TIFF Directory", by David Abrames

2005.08.02 22:39 "[Tiff] Unable to read TIFF Directory", by David Abrames

Hello,

I am getting the following error when I call the TIFFReadDirectory function:

*** TIFF ERROR in module: INTERNAL: No space to read TIFF directory.

This seems to be the result of a failure to allocate memory from a call to TIFFMalloc. The problem is as far as I can determine I have more than enough memory available as other calls to malloc work OK in the program that is calling the libtiff functions.

What I am doing is reading one multi-directory tiff file, updating the directory image and then creating a new directory and writing it to a new multi-directory tiff file.. The first directory is processed OK and I get a new tiff file with the one directory init. However the loop that is processing the tiff file is unable to read the next directory and produces the above error message.

Is there a TIFF function I need to call before calling TIFFReadDirectory to release the previous directory? I also tried TIFFSetDirectory and get the same results. Any suggestions would be appreciated.

Thank you in advance
David Abrames