| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2005.08.03 17:02 "Re: Unable to read TIFF Directory", by David Abrames> You should use TIFFWriteDirectory() before switching to the next IFD. If
> you want open partially written file use TIFFCheckpointDirectory()
> instead.
Dear Andrey,
Thank you for your reply. Sorry I was not clear but I am calling
TIFFWriteDirectory prior to calling TIFFReadDirectory. Here is a sample of
what I am doing...
inTIFF = TIFFOpen("myTIFFfile", "r");
outTiff = TIFFOpen(myNewTiff", "w");
do
{
getTIFFInfo(inTiff); // reads the directory tags
setTIFFInfo(outTiff); // sets the directory tags
// from previous function
image = getBitMap(inTiff); // uses TIFFReadEncodedStrip
// to build a bitmap image
processImage(image); // processes the image
createStrips(outTiff, image); // uses TIFFWriteEncodedStrip
// to convert bitmap into strips
// in the new directory of the
// output tiff file
TIFFWriteDirectory(outTiff);
} while(TIFFReadDirectory(inTiff));
TIFFClose(inTiff);
TIFFClose(outTiff);
The error message is caused by the call to TIFFReadDirectory in the while
statement. Like I said I am getting the first directory (page) in the
output tiff file and it is processed as I expect so the code is working up
to the point where I try and get the next directory. I tried changing the
TIFFReadDirectory to a TIFFSetDirectory and this produces the same error. I
also tried to call malloc after the do-while loop and was able to allocate
1MB of memory successfully so I don't understand why libtiff thinks there is
no space. I am sure I am missing something but I can't figure out what.
David
|
|||||||