2001.05.02 19:08 "TIFFSetDirectory speed?", by Michael O'Rourke

2001.05.02 19:24 "Re: TIFFSetDirectory speed?", by Joris Van Damme

How costly is it to set the directory in say a 5,000 page TIFF file? For instance, if I want to go to page 4,000 can libtiff easily jump there or does it actually have to read the previous 3,999 pages to get to page 4,000?

I've played with this a while ago too, Michael.

As far as I can see, you are supposed to scan each dir wright up to your page 4,000. LibTiff will scan the whole image directory, every time, and doing this 4,000 times can cost you. If there is something I'm missing here, anyone, please correct me.

There does seem to perhaps be a way around it though. I remember I once wanted to examine the routines for adding/reading thumbnail dirs. Cause these directories are indexed with there position in the file. These routines, I expect, can show us how to work with file positions in this context.

That means there would possibly be two partial solutions:

These are only partial solutions, and they might not work after all or perhaps there are easier ways to accomplish more. I didn't dig into it, really, at the time. But I am still very much interested in any comments on this, too.

Joris