Package com.drew.metadata.exif
Class ExifTiffHandler
java.lang.Object
com.drew.metadata.tiff.DirectoryTiffHandler
com.drew.metadata.exif.ExifTiffHandler
- All Implemented Interfaces:
TiffHandler
- Direct Known Subclasses:
PhotoshopTiffHandler
Implementation of
TiffHandler used for handling TIFF tags according to the Exif
standard.
Includes support for camera manufacturer makernotes.
-
Field Summary
Fields inherited from class com.drew.metadata.tiff.DirectoryTiffHandler
_currentDirectory, _metadata -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancustomProcessTag(int tagOffset, Set<Integer> processedIfdOffsets, int tiffHeaderOffset, RandomAccessReader reader, int tagId, int byteCount) private static StringgetReaderString(RandomAccessReader reader, int makernoteOffset, int bytesRequested) 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.private static booleanhandlePrintIM(Directory directory, int tagId) booleanprivate static voidprocessBinary(Directory directory, int tagValueOffset, RandomAccessReader reader, int byteCount, Boolean isSigned, int arrayLength) private static voidprocessKodakMakernote(KodakMakernoteDirectory directory, int tagValueOffset, RandomAccessReader reader) private booleanprocessMakernote(int makernoteOffset, Set<Integer> processedIfdOffsets, int tiffHeaderOffset, RandomAccessReader reader) private static voidprocessPrintIM(PrintIMDirectory directory, int tagValueOffset, RandomAccessReader reader, int byteCount) 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.pmprivate static voidprocessReconyxHyperFire2Makernote(ReconyxHyperFire2MakernoteDirectory directory, int makernoteOffset, RandomAccessReader reader) private static voidprocessReconyxHyperFireMakernote(ReconyxHyperFireMakernoteDirectory directory, int makernoteOffset, RandomAccessReader reader) private static voidprocessReconyxUltraFireMakernote(ReconyxUltraFireMakernoteDirectory directory, int makernoteOffset, RandomAccessReader reader) voidsetTiffMarker(int marker) Receives the 2-byte marker found in the TIFF header.tryCustomProcessFormat(int tagId, int formatCode, long componentCount) booleantryEnterSubIfd(int tagId) Methods inherited from class com.drew.metadata.tiff.DirectoryTiffHandler
endingIFD, error, pushDirectory, setByteArray, setDouble, setDoubleArray, setFloat, setFloatArray, setInt16s, setInt16sArray, setInt16u, setInt16uArray, setInt32s, setInt32sArray, setInt32u, setInt32uArray, setInt8s, setInt8sArray, setInt8u, setInt8uArray, setRational, setRationalArray, setString, warn
-
Constructor Details
-
ExifTiffHandler
-
-
Method Details
-
setTiffMarker
Description copied from interface:TiffHandlerReceives 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
-
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
-
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
-