2002.05.25 00:55 "RE: How multipage is stored", by Bostrup, Tore
...And if I'm not mistaken, each subsequent IFD represents another page if the NewSubfileType tag (254 or FE) has a value of 2. The first IFD is always a full-resolution image, i.e. the first page.
From: David Phillips [mailto:email@example.com] Sent: Friday, May 24, 2002 3:31 PM
To: 'firstname.lastname@example.org'; Tiff
Look at the offset to the next IFD. This is the pointer to the next IFD. If it is zero there are no more images.
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!