1TIFFReadDirectory(3TIFF)                              TIFFReadDirectory(3TIFF)
2
3
4

NAME

6       TIFFReadDirectory  -  get the contents of the next directory in an open
7       TIFF file
8

SYNOPSIS

10       #include <tiffio.h>
11
12       int TIFFReadDirectory(TIFF *tif)
13

DESCRIPTION

15       Read the next directory in the specified file and make it  the  current
16       directory.  Applications  only  need  to call TIFFReadDirectory to read
17       multiple subfiles in a single TIFF file— the first directory in a  file
18       is automatically read when TIFFOpen is called.
19

NOTES

21       If  the library is compiled with STRIPCHOP_SUPPORT enabled, then images
22       that have a single uncompressed strip or tile of data are automatically
23       treated as if they were made up of multiple strips or tiles of approxi‐
24       mately 8 kilobytes each. This operation is done only in-memory; it does
25       not  alter  the  contents of the file. However, the construction of the
26       ``chopped strips'' is visible to the application through the number  of
27       strips [tiles] returned by TIFFNumberOfStrips [TIFFNumberOfTiles].
28

RETURN VALUES

30       If  the next directory was successfully read, 1 is returned. Otherwise,
31       0 is returned if an error was encountered, or  if  there  are  no  more
32       directories to be read.
33

DIAGNOSTICS

35       All  error  messages are directed to the TIFFError(3TIFF) routine.  All
36       warning messages are directed to the TIFFWarning(3TIFF) routine.
37
38       Seek error accessing TIFF directory.  An error occurred while position‐
39       ing to the location of the directory.
40
41       Wrong  data type %d for field "%s".  The tag entry in the directory had
42       an incorrect data type.  For example, an ImageDescription  tag  with  a
43       SHORT data type.
44
45       TIFF  directory  is  missing required "%s" field.  The specified tag is
46       required to be present by the TIFF 5.0 specification, but  is  missing.
47       The directory is (usually) unusable.
48
49       %s:  Rational  with  zero  denominator.  A directory tag has a RATIONAL
50       value whose denominator is zero.
51
52       Incorrect count %d for field "%s" (%lu, expecting  %lu);  tag  ignored.
53       The  specified  tag's  count  field is bad.  For example, a count other
54       than 1 for a SubFileType tag.
55
56       Cannot handle different per-sample values for field "%s".  The tag  has
57       SamplesPerPixel values and they are not all the same; e.g.  BitsPerSam‐
58       ple.  The library is unable to handle images of this sort.
59
60       Count mismatch for field "%s"; expecting %d, got %d.  The  count  field
61       in  a tag does not agree with the number expected by the library.  This
62       should never happen, so if it does, the library  refuses  to  read  the
63       directory.
64
65       Invalid  TIFF  directory;  tags are not sorted in ascending order.  The
66       directory tags are not properly sorted as specified  in  the  TIFF  5.0
67       specification.  This error is not fatal.
68
69       Ignoring  unknown field with tag %d (0x%x).  An unknown tag was encoun‐
70       tered in the directory; the library ignores all such tags.
71
72       TIFF directory is missing required "ImageLength" field.  The image vio‐
73       lates  the  specification by not having a necessary field.  There is no
74       way for the library to recover from this error.
75
76       TIFF directory is missing required  "PlanarConfig"  field.   The  image
77       violates  the  specification by not having a necessary field.  There is
78       no way for the library to recover from this error.
79
80       TIFF directory is missing required "StripOffsets" field.  The image has
81       multiple  strips, but is missing the tag that specifies the file offset
82       to each strip of data.  There is no way for the library to recover from
83       this error.
84
85       TIFF  directory is missing required "TileOffsets" field.  The image has
86       multiple tiles, but is missing the tag that specifies the  file  offset
87       to  each tile of data.  There is no way for the library to recover from
88       this error.
89
90       TIFF directory is missing required "StripByteCounts" field.  The  image
91       has  multiple strips, but is missing the tag that specifies the size of
92       each strip of data.  There is no way for the library  to  recover  from
93       this error.
94
95       TIFF directory is missing required "StripByteCounts" field, calculating
96       from imagelength.  The image violates the specification by not having a
97       necessary  field.   However,  when  the  image is comprised of only one
98       strip or tile, the library will estimate the missing value based on the
99       file size.
100
101       Bogus  "StripByteCounts"  field,  ignoring  and calculating from image‐
102       length.  Certain vendors violate the specification by writing zero  for
103       the  StripByteCounts tag when they want to leave the value unspecified.
104       If the image has a single strip, the library will estimate the  missing
105       value based on the file size.
106

SEE ALSO

108       TIFFOpen(3TIFF),   TIFFWriteDirectory(3TIFF),  TIFFSetDirectory(3TIFF),
109       TIFFSetSubDirectory(3TIFF), libtiff(3TIFF)
110
111       Libtiff library home page: http://www.simplesystems.org/libtiff/
112
113
114
115libtiff                        October 15, 1995       TIFFReadDirectory(3TIFF)
Impressum