roentgen b75cab
.\" $Id: TIFFReadDirectory.3tiff,v 1.3 2010-12-12 01:45:35 faxguy Exp $
roentgen b75cab
.\"
roentgen b75cab
.\" Copyright (c) 1988-1997 Sam Leffler
roentgen b75cab
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
roentgen b75cab
.\"
roentgen b75cab
.\" Permission to use, copy, modify, distribute, and sell this software and 
roentgen b75cab
.\" its documentation for any purpose is hereby granted without fee, provided
roentgen b75cab
.\" that (i) the above copyright notices and this permission notice appear in
roentgen b75cab
.\" all copies of the software and related documentation, and (ii) the names of
roentgen b75cab
.\" Sam Leffler and Silicon Graphics may not be used in any advertising or
roentgen b75cab
.\" publicity relating to the software without the specific, prior written
roentgen b75cab
.\" permission of Sam Leffler and Silicon Graphics.
roentgen b75cab
.\" 
roentgen b75cab
.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
roentgen b75cab
.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
roentgen b75cab
.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
roentgen b75cab
.\" 
roentgen b75cab
.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
roentgen b75cab
.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
roentgen b75cab
.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
roentgen b75cab
.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
roentgen b75cab
.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
roentgen b75cab
.\" OF THIS SOFTWARE.
roentgen b75cab
.\"
roentgen b75cab
.if n .po 0
roentgen b75cab
.TH TIFFReadDirectory 3TIFF "October 15, 1995" "libtiff"
roentgen b75cab
.SH NAME
roentgen b75cab
TIFFReadDirectory \- get the contents of the next directory in an open
roentgen b75cab
.SM TIFF
roentgen b75cab
file
roentgen b75cab
.SH SYNOPSIS
roentgen b75cab
.B "#include <tiffio.h>"</tiffio.h>
roentgen b75cab
.sp
roentgen b75cab
.BI "int TIFFReadDirectory(TIFF *" tif ")"
roentgen b75cab
.SH DESCRIPTION
roentgen b75cab
Read the next directory in the specified file and make it the current
roentgen b75cab
directory. Applications only need to call
roentgen b75cab
.I TIFFReadDirectory
roentgen b75cab
to read multiple subfiles in a single
roentgen b75cab
.SM TIFF
roentgen b75cab
file\(em
roentgen b75cab
the first directory in a file is automatically read when
roentgen b75cab
.IR TIFFOpen
roentgen b75cab
is called.
roentgen b75cab
.SH NOTES
roentgen b75cab
If the library is compiled with 
roentgen b75cab
.SM STRIPCHOP_SUPPORT
roentgen b75cab
enabled, then images that have a single uncompressed strip or tile of data are
roentgen b75cab
automatically treated as if they were made up of multiple strips or tiles of
roentgen b75cab
approximately 8 kilobytes each. This operation is done only in-memory; it does
roentgen b75cab
not alter the contents of the file. However, the construction of the ``chopped
roentgen b75cab
strips'' is visible to the application through the number of strips [tiles]
roentgen b75cab
returned by 
roentgen b75cab
.I TIFFNumberOfStrips
roentgen b75cab
[\c
roentgen b75cab
.IR TIFFNumberOfTiles ].
roentgen b75cab
.SH "RETURN VALUES"
roentgen b75cab
If the next directory was successfully read, 1 is returned. Otherwise, 0 is
roentgen b75cab
returned if an error was encountered, or if there are no more directories to
roentgen b75cab
be read.
roentgen b75cab
.SH DIAGNOSTICS
roentgen b75cab
All error messages are directed to the
roentgen b75cab
.IR TIFFError (3TIFF)
roentgen b75cab
routine.
roentgen b75cab
All warning messages are directed to the
roentgen b75cab
.IR TIFFWarning (3TIFF)
roentgen b75cab
routine.
roentgen b75cab
.PP
roentgen b75cab
\fBSeek error accessing TIFF directory\fP.
roentgen b75cab
An error occurred while positioning to the location of the
roentgen b75cab
directory.
roentgen b75cab
.PP
roentgen b75cab
\fBWrong data type %d for field "%s"\fP.
roentgen b75cab
The tag entry in the directory had an incorrect data type.
roentgen b75cab
For example, an
roentgen b75cab
.I ImageDescription
roentgen b75cab
tag with a
roentgen b75cab
.SM SHORT
roentgen b75cab
data type.
roentgen b75cab
.PP
roentgen b75cab
\fBTIFF directory is missing required "%s" field\fP.
roentgen b75cab
The specified tag is required to be present by the
roentgen b75cab
.SM TIFF
roentgen b75cab
5.0 specification, but is missing.
roentgen b75cab
The directory is (usually) unusable.
roentgen b75cab
.PP
roentgen b75cab
\fB%s: Rational with zero denominator\fP.
roentgen b75cab
A directory tag has a
roentgen b75cab
.SM RATIONAL
roentgen b75cab
value whose denominator is zero.
roentgen b75cab
.PP
roentgen b75cab
\fBIncorrect count %d for field "%s" (%lu, expecting %lu); tag ignored\fP.
roentgen b75cab
The specified tag's count field is bad.
roentgen b75cab
For example, a count other than 1 for a
roentgen b75cab
.I SubFileType
roentgen b75cab
tag.
roentgen b75cab
.PP
roentgen b75cab
\fBCannot handle different per-sample values for field "%s"\fP.
roentgen b75cab
The tag has
roentgen b75cab
.I SamplesPerPixel
roentgen b75cab
values and they are not all the same; e.g.
roentgen b75cab
.IR BitsPerSample .
roentgen b75cab
The library is unable to handle images of this sort.
roentgen b75cab
.PP
roentgen b75cab
\fBCount mismatch for field "%s"; expecting %d, got %d\fP.
roentgen b75cab
The count field in a
roentgen b75cab
tag does not agree with the number expected by the library.
roentgen b75cab
This should never happen, so if it does, the library refuses to
roentgen b75cab
read the directory.
roentgen b75cab
.PP
roentgen b75cab
\fBInvalid TIFF directory; tags are not sorted in ascending order\fP.
roentgen b75cab
The directory tags are not properly sorted as specified
roentgen b75cab
in the
roentgen b75cab
.SM TIFF
roentgen b75cab
5.0 specification.
roentgen b75cab
This error is not fatal.
roentgen b75cab
.PP
roentgen b75cab
\fBIgnoring unknown field with tag %d (0x%x)\fP.
roentgen b75cab
An unknown tag was encountered in the directory;
roentgen b75cab
the library ignores all such tags.
roentgen b75cab
.PP
roentgen b75cab
\fBTIFF directory is missing required "ImageLength" field\fP.
roentgen b75cab
The image violates the specification by not having a necessary field.
roentgen b75cab
There is no way for the library to recover from this error.
roentgen b75cab
.PP
roentgen b75cab
\fBTIFF directory is missing required "PlanarConfig" field\fP.
roentgen b75cab
The image violates the specification by not having a necessary field.
roentgen b75cab
There is no way for the library to recover from this error.
roentgen b75cab
.PP
roentgen b75cab
\fBTIFF directory is missing required "StripOffsets" field\fP.
roentgen b75cab
The image has multiple strips, but is missing the tag that
roentgen b75cab
specifies the file offset to each strip of data.
roentgen b75cab
There is no way for the library to recover from this error.
roentgen b75cab
.PP
roentgen b75cab
\fBTIFF directory is missing required "TileOffsets" field\fP.
roentgen b75cab
The image has multiple tiles, but is missing the tag that
roentgen b75cab
specifies the file offset to each tile of data.
roentgen b75cab
There is no way for the library to recover from this error.
roentgen b75cab
.PP
roentgen b75cab
\fBTIFF directory is missing required "StripByteCounts" field\fP.
roentgen b75cab
The image has multiple strips, but is missing the tag that
roentgen b75cab
specifies the size of each strip of data.
roentgen b75cab
There is no way for the library to recover from this error.
roentgen b75cab
.PP
roentgen b75cab
\fBTIFF directory is missing required "StripByteCounts" field, calculating from imagelength\fP.
roentgen b75cab
The image violates the specification by not having a necessary field.
roentgen b75cab
However, when the image is comprised of only one strip or tile, the
roentgen b75cab
library will estimate the missing value based on the file size.
roentgen b75cab
.PP
roentgen b75cab
\fBBogus "StripByteCounts" field, ignoring and calculating from imagelength\fP.
roentgen b75cab
Certain vendors violate the specification by writing zero for
roentgen b75cab
the StripByteCounts tag when they want to leave the value
roentgen b75cab
unspecified.
roentgen b75cab
If the image has a single strip, the library will estimate
roentgen b75cab
the missing value based on the file size.
roentgen b75cab
.SH "SEE ALSO"
roentgen b75cab
.BR TIFFOpen (3TIFF),
roentgen b75cab
.BR TIFFWriteDirectory (3TIFF),
roentgen b75cab
.BR TIFFSetDirectory (3TIFF),
roentgen b75cab
.BR TIFFSetSubDirectory (3TIFF),
roentgen b75cab
.BR libtiff (3TIFF)
roentgen b75cab
.PP
roentgen b75cab
Libtiff library home page:
roentgen b75cab
.BR http://www.remotesensing.org/libtiff/