Class DirectoryReader

java.lang.Object
is.galia.codec.tiff.DirectoryReader

public final class DirectoryReader extends Object

Combination TIFF and EXIF Image File Directory (IFD) reader.

The EXIF container structure is similar to and based on TIFF, and this reader can parse the IFD portions of a TIFF 6.0 file.

EXIF 3.0 is supported.

BigTIFF is also supported.

The EXIF standard includes four tag sets:

  1. Baseline TIFF
  2. EXIF
  3. GPS
  4. Interoperability

The Baseline TIFF tags defined in EXIF are a subset of the tags in the TIFF specification.

Instances must be initialized with one or more tag sets prior to reading. There are several such implementations in this package, and custom ones can also be supplied. TagSet.newBaselineSuperset() can be used to obtain a superset of all baseline tags, including support for the EXIF sub-IFDs and all other known sub-IFDs.

  • Constructor Details

    • DirectoryReader

      public DirectoryReader()
  • Method Details

    • addTagSet

      public void addTagSet(TagSet tagSet)
    • getTagSet

      public TagSet getTagSet(int ifdPointer)
    • getTagSets

      public Set<TagSet> getTagSets()
      Returns:
      Unmodifiable instance containing all tag sets recognized by the reader.
    • isBigTIFF

      public boolean isBigTIFF()
    • setSource

      public void setSource(ImageInputStream inputStream)
      Parameters:
      inputStream - Instance initialized to the starting position of the EXIF data (or JPEG APP0 EXIF segment data).
    • iterator

      public DirectoryIterator iterator() throws IOException
      Returns:
      Iterator over all top-level sibling IFDs.
      Throws:
      IOException
    • readAll

      public List<Directory> readAll() throws IOException
      Reads all directories.
      Throws:
      IOException
    • readFirst

      public Directory readFirst() throws IOException
      Reads only the first directory.
      Throws:
      IOException