Class ExifTiffHandler

java.lang.Object
com.drew.metadata.tiff.DirectoryTiffHandler
com.drew.metadata.exif.ExifTiffHandler
All Implemented Interfaces:
TiffHandler
Direct Known Subclasses:
PhotoshopTiffHandler

public class ExifTiffHandler extends DirectoryTiffHandler
Implementation of TiffHandler used for handling TIFF tags according to the Exif standard.

Includes support for camera manufacturer makernotes.

  • Constructor Details

    • ExifTiffHandler

      public ExifTiffHandler(Metadata metadata, Directory parentDirectory)
  • Method Details

    • setTiffMarker

      public void setTiffMarker(int marker) throws TiffProcessingException
      Description copied from interface: TiffHandler
      Receives the 2-byte marker found in the TIFF header.

      Implementations are not obligated to use this information for any purpose, though it may be useful for validation or perhaps differentiating the type of mapping to use for observed tags and IFDs.

      Parameters:
      marker - the 2-byte value found at position 2 of the TIFF header
      Throws:
      TiffProcessingException
    • tryEnterSubIfd

      public boolean tryEnterSubIfd(int tagId)
    • hasFollowerIfd

      public boolean hasFollowerIfd()
    • tryCustomProcessFormat

      public Long tryCustomProcessFormat(int tagId, int formatCode, long componentCount)
    • customProcessTag

      public boolean customProcessTag(int tagOffset, Set<Integer> processedIfdOffsets, int tiffHeaderOffset, RandomAccessReader reader, int tagId, int byteCount) throws IOException
      Throws:
      IOException
    • processBinary

      private static void processBinary(Directory directory, int tagValueOffset, RandomAccessReader reader, int byteCount, Boolean isSigned, int arrayLength) throws IOException
      Throws:
      IOException
    • getReaderString

      private static String getReaderString(RandomAccessReader reader, int makernoteOffset, int bytesRequested) throws IOException
      Read a given number of bytes from the stream This method is employed to "suppress" attempts to read beyond end of the file as may happen at the beginning of processMakernote when we read increasingly longer camera makes. Instead of failing altogether in this context we return an empty string which will fail all sensible attempts to compare to makes while avoiding a full-on failure.
      Throws:
      IOException
    • processMakernote

      private boolean processMakernote(int makernoteOffset, Set<Integer> processedIfdOffsets, int tiffHeaderOffset, RandomAccessReader reader) throws IOException
      Throws:
      IOException
    • handlePrintIM

      private static boolean handlePrintIM(Directory directory, int tagId)
    • processPrintIM

      private static void processPrintIM(PrintIMDirectory directory, int tagValueOffset, RandomAccessReader reader, int byteCount) throws IOException
      Process PrintIM IFD Converted from Exiftool version 10.33 created by Phil Harvey http://www.sno.phy.queensu.ca/~phil/exiftool/ lib\Image\ExifTool\PrintIM.pm
      Throws:
      IOException
    • processKodakMakernote

      private static void processKodakMakernote(KodakMakernoteDirectory directory, int tagValueOffset, RandomAccessReader reader)
    • processReconyxHyperFireMakernote

      private static void processReconyxHyperFireMakernote(ReconyxHyperFireMakernoteDirectory directory, int makernoteOffset, RandomAccessReader reader) throws IOException
      Throws:
      IOException
    • processReconyxHyperFire2Makernote

      private static void processReconyxHyperFire2Makernote(ReconyxHyperFire2MakernoteDirectory directory, int makernoteOffset, RandomAccessReader reader) throws IOException
      Throws:
      IOException
    • processReconyxUltraFireMakernote

      private static void processReconyxUltraFireMakernote(ReconyxUltraFireMakernoteDirectory directory, int makernoteOffset, RandomAccessReader reader) throws IOException
      Throws:
      IOException