logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Author

       LibTIFF contributors

Description

       Read  the  next directory in the specified file and make it the current directory. Applications only need
       to call TIFFReadDirectory() to read multiple subfiles in a single TIFF fileβ€”(the  first  directory  in  a
       file is automatically read when TIFFOpen() is called.

Diagnostics

       All error messages are directed to the TIFFErrorExtR() routine.  Likewise, warning messages are  directed
       to the TIFFWarningExtR() routine.

       SeekerroraccessingTIFFdirectory:
          An error occurred while positioning to the location of the directory.

       Wrongdatatype%dforfield"%s":
          The  tag entry in the directory had an incorrect data type.  For example, an ImageDescription tag with
          a SHORT data type.

       TIFFdirectoryismissingrequired"%s"field:
          The specified tag is required to be present by the  TIFF  5.0  specification,  but  is  missing.   The
          directory is (usually) unusable.

       %s:Rationalwithzerodenominator:
          A directory tag has a RATIONAL value whose denominator is zero.

       Incorrectcount%dforfield"%s"(%lu,expecting%lu);tagignored:
          The specified tag's count field is bad.  For example, a count other than 1 for a SubFileType tag.

       Cannothandledifferentper-samplevaluesforfield"%s":
          The tag has SamplesPerPixel values and they are not all the same; e.g.  BitsPerSample.  The library is
          unable to handle images of this sort.

       Countmismatchforfield"%s";expecting%d,got%d:
          The  count  field  in  a tag does not agree with the number expected by the library. This should never
          happen, so if it does, the library refuses to read the directory.

       InvalidTIFFdirectory;tagsarenotsortedinascendingorder:
          The directory tags are not properly sorted as specified in the TIFF 5.0 specification.  This error  is
          not fatal.

       Ignoringunknownfieldwithtag%d(0x%x):
          An unknown tag was encountered in the directory; the library ignores all such tags.

       TIFFdirectoryismissingrequired"ImageLength"field:
          The image violates the specification by not having a necessary field.  There is no way for the library
          to recover from this error.

       TIFFdirectoryismissingrequired"PlanarConfig"field:
          The image violates the specification by not having a necessary field.  There is no way for the library
          to recover from this error.

       TIFFdirectoryismissingrequired"StripOffsets"field:
          The  image has multiple strips, but is missing the tag that specifies the file offset to each strip of
          data.  There is no way for the library to recover from this error.

       TIFFdirectoryismissingrequired"TileOffsets"field:
          The image has multiple tiles, but is missing the tag that specifies the file offset to  each  tile  of
          data.  There is no way for the library to recover from this error.

       TIFFdirectoryismissingrequired"StripByteCounts"field:
          The  image  has multiple strips, but is missing the tag that specifies the size of each strip of data.
          There is no way for the library to recover from this error.

       TIFFdirectoryismissingrequired"StripByteCounts"field,calculatingfromimagelength:
          The image violates the specification by not having a necessary field.   However,  when  the  image  is
          comprised  of  only  one  strip or tile, the library will estimate the missing value based on the file
          size.

       Bogus"StripByteCounts"field,ignoringandcalculatingfromimagelength:
          Certain vendors violate the specification by writing zero for the StripByteCounts tag when  they  want
          to  leave  the  value  unspecified.   If  the  image has a single strip, the library will estimate the
          missing value based on the file size.

Name

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

Notes

       If  the  library  is compiled with STRIPCHOP_SUPPORT enabled, then images that have a single uncompressed
       strip or tile of data are automatically treated as if they were made up of multiple strips  or  tiles  of
       approximately  8 kilobytes each. This operation is done only in-memory; it does not alter the contents of
       the file. However, the construction of the "chopped strips" is visible to  the  application  through  the
       number of strips [tiles] returned by TIFFNumberOfStrips() [TIFFNumberOfTiles()].

Return Values

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

See Also

TIFFOpen  (3tiff),  TIFFCreateDirectory  (3tiff),   TIFFCustomDirectory   (3tiff),   TIFFquery   (3tiff),
       TIFFWriteDirectory (3tiff), TIFFSetDirectory (3tiff), MultiPage/MultiImageTIFF, libtiff (3tiff)

Synopsis

          #include <tiffio.h>

       intTIFFReadDirectory(TIFF*tif)

See Also