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

2001.05.02 19:47 "Re: TIFFSetDirectory speed?", by Frank Warmerdam

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?


You can go directly to a TIFF direct using TIFFSetSubDirectory() if you know the byte offset. However, if all you have is the page number you will need to use TIFFSetDirectory().

Luckily TIFFSetDirectory() appears to just read minimal information from each intermediate directory as it searches for the target directory. It particular it only parses all the tags in the directory once it finds the directory it wants. But it would generally do 5000 disk seeks and reads which could be quite expensive if the directories are distributed widely through the file.

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent