AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2002.08.22 22:17 "Problem Reading MultiPage TIFFs", by Steven Luke
2002.08.22 22:39 "RE: Problem Reading MultiPage TIFFs", by Rypysc, George
2002.08.30 19:04 "Re: Problem Reading MultiPage TIFFs", by Steven Luke
2002.08.30 20:05 "RE: Problem Reading MultiPage TIFFs", by Bostrup, Tore
2002.08.31 13:12 "Re: Problem Reading MultiPage TIFFs", by Steven Luke
2002.09.02 13:20 "Re: Problem Reading MultiPage TIFFs", by Antonio E. Scuri
2002.09.03 17:58 "RE: Problem Reading MultiPage TIFFs", by Frank Palmieri
2002.09.03 18:32 "Re: Problem Reading MultiPage TIFFs", by Frank Warmerdam
2002.09.05 04:50 "Re: Problem Reading MultiPage TIFFs", by Steven Luke

2002.08.22 22:39 "RE: Problem Reading MultiPage TIFFs", by Rypysc, George

For the page counting code, I'll refer you to the sample code at http://www.libtiff.org/libtiff.html#Dirs which is basically:

do {
    count++;
   } while (TIFFReadDirectory(tif));

Your code will give one less page than there really is or a count of 1 if you happen to forget the "!".

One last thing (related probably). I have also had trouble counting the pages in the TIFF. I was using this code:

do
{ TIFFReadDirectory (tif);
   count++;
} while (!TIFFLastDirectory (tif));

but it would only give me a count of 1 (saying my first directory is my last one). But I know that the image had 20 pages to it.

I hope that helps with your page reading problem.

George Rypysc

[Sorry about the legalese that I assume will be below, my company tacks it onto all out going e-mails]

This communication, including attachments, is for the exclusive use of
addressee and may contain proprietary, confidential or privileged
information. If you are not the intended recipient, any use, copying,
disclosure, dissemination or distribution is strictly prohibited. If
you are not the intended recipient, please notify the sender
immediately by return email and delete this communication and destroy all copies.