2004.12.11 02:06 "[Tiff] TIFF Pyramid", by Eric Vergnaud

2004.12.13 02:45 "Re: [Tiff] TIFF Pyramid", by Joris Van Damme


Yes I know how it is structured, since that is described in a tech note from Adobe. Each image in the main ifd has a subifd for the lowres. All lowres are chained in that subifd.

What I'm looking for is sample code to write that.

I see. Sorry I misunderstood.

I'm not a C coder, but as you are you might be able to make sense of it. In the unit tif_dirwrite, function _TIFFWriteDirectory, section SubIFDs tag writing, there's this remark in the code:

    * Total hack: if this directory includes a SubIFD
    * tag then force the next <n> directories to be
    * written as ``sub directories'' of this one.  This
    * is used to write things like thumbnails and
    * image masks that one wants to keep out of the
    * normal directory linkage access mechanism.

I am in particular not very sure what '<n>' means here. But presumably, you could set up your first page IFD in the normal way, including the SubIFD tag, pass the raster data normal way, and next use TIFFWriteDirectory to flush it. Next <n> times you repeat the tagsetup-rasterpassing-TIFFWriteDirectory scheme, you'll be writing the SubIFD chain, instead of appending to the main chain.

It does make some sense to me if <n> means the value you pass for the SubIFD tag, since that value could only be dummy anyway. But I'm only guessing.

If you can make sense of any of this, please let us know.

Joris Van Damme
Download your free TIFF tag viewer for windows here: