Package gov.nih.mipav.model.file
Class MetadataExtractor.ExifTiffHandler
java.lang.Object
gov.nih.mipav.model.file.MetadataExtractor.DirectoryTiffHandler
gov.nih.mipav.model.file.MetadataExtractor.ExifTiffHandler
- All Implemented Interfaces:
MetadataExtractor.TiffHandler
- Enclosing class:
MetadataExtractor
Implementation of
used for handling TIFF tags according to the Exif
standard.
invalid reference
com.drew.imaging.tiff.TiffHandler
Includes support for camera manufacturer makernotes.
- Author:
- Drew Noakes https://drewnoakes.com
-
Field Summary
Fields inherited from class gov.nih.mipav.model.file.MetadataExtractor.DirectoryTiffHandler
_currentDirectory, _metadata -
Constructor Summary
ConstructorsConstructorDescriptionExifTiffHandler(MetadataExtractor.Metadata metadata, MetadataExtractor.Directory parentDirectory) -
Method Summary
Modifier and TypeMethodDescriptionbooleancustomProcessTag(int tagOffset, Set<Integer> processedIfdOffsets, int tiffHeaderOffset, MetadataExtractor.RandomAccessReader reader, int tagId, int byteCount) private StringgetReaderString(MetadataExtractor.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 booleanhandlePrintIM(MetadataExtractor.Directory directory, int tagId) booleanprivate voidprocessBinary(MetadataExtractor.Directory directory, int tagValueOffset, MetadataExtractor.RandomAccessReader reader, int byteCount, Boolean isSigned, int arrayLength) private voidprocessKodakMakernote(MetadataExtractor.KodakMakernoteDirectory directory, int tagValueOffset, MetadataExtractor.RandomAccessReader reader) private booleanprocessMakernote(int makernoteOffset, Set<Integer> processedIfdOffsets, int tiffHeaderOffset, MetadataExtractor.RandomAccessReader reader) private voidprocessPrintIM(MetadataExtractor.PrintIMDirectory directory, int tagValueOffset, MetadataExtractor.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 voidprocessReconyxHyperFire2Makernote(MetadataExtractor.ReconyxHyperFire2MakernoteDirectory directory, int makernoteOffset, MetadataExtractor.RandomAccessReader reader) private voidprocessReconyxHyperFireMakernote(MetadataExtractor.ReconyxHyperFireMakernoteDirectory directory, int makernoteOffset, MetadataExtractor.RandomAccessReader reader) private voidprocessReconyxUltraFireMakernote(MetadataExtractor.ReconyxUltraFireMakernoteDirectory directory, int makernoteOffset, MetadataExtractor.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 gov.nih.mipav.model.file.MetadataExtractor.DirectoryTiffHandler
endingIFD, error, pushAppleMakernoteDirectory, pushCanonMakernoteDirectory, pushCasioType1MakernoteDirectory, pushCasioType2MakernoteDirectory, pushDirectory, pushErrorDirectory, pushExifIFD0Directory, pushExifImageDirectory, pushExifInteropDirectory, pushExifThumbnailDirectory, pushFujifilmMakernoteDirectory, pushGpsDirectory, pushKyoceraMakernoteDirectory, pushLeicaMakernoteDirectory, pushLeicaType5MakernoteDirectory, pushNikonType1MakernoteDirectory, pushNikonType2MakernoteDirectory, pushOlympusCameraSettingsMakernoteDirectory, pushOlympusEquipmentMakernoteDirectory, pushOlympusFocusInfoMakernoteDirectory, pushOlympusImageProcessingMakernoteDirectory, pushOlympusMakernoteDirectory, pushOlympusRawDevelopment2MakernoteDirectory, pushOlympusRawDevelopmentMakernoteDirectory, pushOlympusRawInfoMakernoteDirectory, pushPanasonicMakernoteDirectory, pushPanasonicRawIFD0Directory, pushPentaxMakernoteDirectory, pushRicohMakernoteDirectory, pushSamsungType2MakernoteDirectory, pushSanyoMakernoteDirectory, pushSigmaMakernoteDirectory, pushSonyType1MakernoteDirectory, pushSonyType6MakernoteDirectory, pushSubExifIFDDirectory, setByteArray, setDouble, setDoubleArray, setFloat, setFloatArray, setInt16s, setInt16sArray, setInt16u, setInt16uArray, setInt32s, setInt32sArray, setInt32u, setInt32uArray, setInt8s, setInt8sArray, setInt8u, setInt8uArray, setRational, setRationalArray, setString, warn
-
Constructor Details
-
ExifTiffHandler
public ExifTiffHandler(MetadataExtractor.Metadata metadata, MetadataExtractor.Directory parentDirectory)
-
-
Method Details
-
setTiffMarker
Description copied from interface:MetadataExtractor.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:
MetadataExtractor.TiffProcessingException
-
tryEnterSubIfd
public boolean tryEnterSubIfd(int tagId) -
hasFollowerIfd
public boolean hasFollowerIfd() -
tryCustomProcessFormat
-
customProcessTag
public boolean customProcessTag(int tagOffset, Set<Integer> processedIfdOffsets, int tiffHeaderOffset, MetadataExtractor.RandomAccessReader reader, int tagId, int byteCount) throws IOException - Throws:
IOException
-
processBinary
private void processBinary(MetadataExtractor.Directory directory, int tagValueOffset, MetadataExtractor.RandomAccessReader reader, int byteCount, Boolean isSigned, int arrayLength) throws IOException - Throws:
IOException
-
getReaderString
private String getReaderString(MetadataExtractor.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 a full-on failure.- Throws:
IOException
-
processMakernote
private boolean processMakernote(int makernoteOffset, Set<Integer> processedIfdOffsets, int tiffHeaderOffset, MetadataExtractor.RandomAccessReader reader) throws IOException - Throws:
IOException
-
handlePrintIM
-
processPrintIM
private void processPrintIM(MetadataExtractor.PrintIMDirectory directory, int tagValueOffset, MetadataExtractor.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 void processKodakMakernote(MetadataExtractor.KodakMakernoteDirectory directory, int tagValueOffset, MetadataExtractor.RandomAccessReader reader) -
processReconyxHyperFireMakernote
private void processReconyxHyperFireMakernote(MetadataExtractor.ReconyxHyperFireMakernoteDirectory directory, int makernoteOffset, MetadataExtractor.RandomAccessReader reader) throws IOException - Throws:
IOException
-
processReconyxHyperFire2Makernote
private void processReconyxHyperFire2Makernote(MetadataExtractor.ReconyxHyperFire2MakernoteDirectory directory, int makernoteOffset, MetadataExtractor.RandomAccessReader reader) throws IOException - Throws:
IOException
-
processReconyxUltraFireMakernote
private void processReconyxUltraFireMakernote(MetadataExtractor.ReconyxUltraFireMakernoteDirectory directory, int makernoteOffset, MetadataExtractor.RandomAccessReader reader) throws IOException - Throws:
IOException
-