2002.05.24 19:21 "How multipage is stored", by Scott Weber

2002.05.24 19:21 "How multipage is stored", by Scott Weber

Ok, I've read the spec, and been playing with many pieces.

We have a need to combine multiple pages into a single file. tiffcp does that, so I'm studying the code. I built a multipage tif from individuals, and it's fine. I then tried to dissect it with the spec, and can't figure out one thing. How does it know there's a second page?

There is a directory entry FE which is supposed to indicate multipage, but all it's value bits are set to zero.

It moved the directory (which people call IFD?) to a block after the data strip (that's fine because the header points there).

I found the second directory after the second data strip, again, that's fine. The second dir has pointer to the data, width values, height, etc. I understand all of it. But I can't see anywhere in the way the file is built that links the first page to the second.

It seems to me when the first page is read, it would think that that's all there is. As I hand walk through the file, I go through the directory, come to the end of the first dir, read the strip, and that's it. How would a program know that there is a second page after the first one?

Any help is appreciated!

-Scott Weber