2006.10.30 22:12 "Re: [Tiff] Tiles or Strips?", by Joris Van Damme
I'm new to LibTIFF and I've been studying the docs. I've perused a few sample programs start out with the supposed foreknowledge that the raster is stored as strips or tiles, and that does not sit well with the cautious programmer in me i.e., one day such a program will encounter raster thats written in the *other* format(?).
Whats the best approach to writing a does one write a flexible reader i.e., determining the beforehand if the data is stored as strips or tiles?
If you use LibTiff, you can use the function TIFFIsTiled to determine whether a particular IFD contains strips or tiles, and respond accordingly.
If you don't use LibTiff, but a writing your own reader, an investigation of the tag set will determine the format. Either all of TileWidth, TileLength, TileOffsets and TileByteCounts is present, in which case it contains tiles, or either all of RowsPerStrip, StripOffsets, and StripByteCounts is present, in which case it contains strips.
Does that answer your question? I'm not sure how to interpret your question... When exactly is 'beforehand'?
Joris Van Damme
Download your free TIFF tag viewer for windows here: