IFD Terminology

Each TIFF file has one or more variable-length TIFF Image Directories (TID), which describes the properties of the file’s image data. The TID is a list of description fields, which are called tags. Each field has an identifier that describes its data. For example, identifier 256 (hex 100) marks a tag that contains the width of an image in pixels. The Document Imaging SDK supplies 76 predefined tags to describe image information, such as size, compression type, color data, information about the author, etc.

A TIFF file may contain several images. Generally, one of them is the full resolution image; the others being lower resolution copies or non-rectangular masks defining which part of the image must be displayed. Sometimes a TIFF file contains different pages of a multi-page image. The NEWSUBFILETYPE or the SUBFILETYPE tag contains information about this (see function NumberOfTiffImages()).

A TIFF field is a logical entity consisting of TIFF tag and its value. This logical concept is implemented as an IFD Entry, plus the actual value if it doesn't fit into the value/offset part, the last 4 bytes of the IFD Entry. The terms TIFF field and IFD entry are interchangeable in most contexts.

Sort Order

The entries in an IFD must be sorted in ascending order by Tag. Note that this is not the order in which the fields are  described in this document. The Values to which directory entries point need not be in any particular order in the file.

Value/Offset

To save time and space, the Value Offset contains the Value instead of pointing to the Value if and only if the Value fits into 4 bytes. If the Value is shorter than 4 bytes, it is left justified within the 4-byte Value Offset, i.e., stored in the lower-numbered bytes. The Type and Count of the field determine whether or not the Value fits in 4 bytes.

Count

(Called Length in previous versions of the specification.) Note that the Count is the number of values, not the total number of bytes. A single 16-bit word (SHORT) has a Count of 1, not 2, for example.