2005.08.03 14:17 "Re: [Tiff] Unable to read TIFF Directory", by Andrey Kiselev
On Tue, Aug 02, 2005 at 06:39:16PM -0400, David Abrames wrote:
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.
You should use TIFFWriteDirectory() before switching to the next IFD. If you want open partially written file use TIFFCheckpointDirectory() instead.
Andrey V. Kiselev
Home phone: +7 812 5970603 ICQ# 26871517