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
public class MetadataExtractor.ExifTiffHandler extends MetadataExtractor.DirectoryTiffHandler
Implementation ofcom.drew.imaging.tiff.TiffHandler
used for handling TIFF tags according to the Exif standard.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
Constructors Constructor Description ExifTiffHandler(MetadataExtractor.Metadata metadata, MetadataExtractor.Directory parentDirectory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
customProcessTag(int tagOffset, java.util.Set<java.lang.Integer> processedIfdOffsets, int tiffHeaderOffset, MetadataExtractor.RandomAccessReader reader, int tagId, int byteCount)
private java.lang.String
getReaderString(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 boolean
handlePrintIM(MetadataExtractor.Directory directory, int tagId)
boolean
hasFollowerIfd()
private void
processBinary(MetadataExtractor.Directory directory, int tagValueOffset, MetadataExtractor.RandomAccessReader reader, int byteCount, java.lang.Boolean isSigned, int arrayLength)
private void
processKodakMakernote(MetadataExtractor.KodakMakernoteDirectory directory, int tagValueOffset, MetadataExtractor.RandomAccessReader reader)
private boolean
processMakernote(int makernoteOffset, java.util.Set<java.lang.Integer> processedIfdOffsets, int tiffHeaderOffset, MetadataExtractor.RandomAccessReader reader)
private void
processPrintIM(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 void
processReconyxHyperFire2Makernote(MetadataExtractor.ReconyxHyperFire2MakernoteDirectory directory, int makernoteOffset, MetadataExtractor.RandomAccessReader reader)
private void
processReconyxHyperFireMakernote(MetadataExtractor.ReconyxHyperFireMakernoteDirectory directory, int makernoteOffset, MetadataExtractor.RandomAccessReader reader)
private void
processReconyxUltraFireMakernote(MetadataExtractor.ReconyxUltraFireMakernoteDirectory directory, int makernoteOffset, MetadataExtractor.RandomAccessReader reader)
void
setTiffMarker(int marker)
Receives the 2-byte marker found in the TIFF header.java.lang.Long
tryCustomProcessFormat(int tagId, int formatCode, long componentCount)
boolean
tryEnterSubIfd(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 Detail
-
ExifTiffHandler
public ExifTiffHandler(MetadataExtractor.Metadata metadata, MetadataExtractor.Directory parentDirectory)
-
-
Method Detail
-
setTiffMarker
public void setTiffMarker(int marker) throws MetadataExtractor.TiffProcessingException
Description copied from interface:MetadataExtractor.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:
MetadataExtractor.TiffProcessingException
-
tryEnterSubIfd
public boolean tryEnterSubIfd(int tagId)
-
hasFollowerIfd
public boolean hasFollowerIfd()
-
tryCustomProcessFormat
public java.lang.Long tryCustomProcessFormat(int tagId, int formatCode, long componentCount)
-
customProcessTag
public boolean customProcessTag(int tagOffset, java.util.Set<java.lang.Integer> processedIfdOffsets, int tiffHeaderOffset, MetadataExtractor.RandomAccessReader reader, int tagId, int byteCount) throws java.io.IOException
- Throws:
java.io.IOException
-
processBinary
private void processBinary(MetadataExtractor.Directory directory, int tagValueOffset, MetadataExtractor.RandomAccessReader reader, int byteCount, java.lang.Boolean isSigned, int arrayLength) throws java.io.IOException
- Throws:
java.io.IOException
-
getReaderString
private java.lang.String getReaderString(MetadataExtractor.RandomAccessReader reader, int makernoteOffset, int bytesRequested) throws java.io.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:
java.io.IOException
-
processMakernote
private boolean processMakernote(int makernoteOffset, java.util.Set<java.lang.Integer> processedIfdOffsets, int tiffHeaderOffset, MetadataExtractor.RandomAccessReader reader) throws java.io.IOException
- Throws:
java.io.IOException
-
handlePrintIM
private boolean handlePrintIM(MetadataExtractor.Directory directory, int tagId)
-
processPrintIM
private void processPrintIM(MetadataExtractor.PrintIMDirectory directory, int tagValueOffset, MetadataExtractor.RandomAccessReader reader, int byteCount) throws java.io.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:
java.io.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 java.io.IOException
- Throws:
java.io.IOException
-
processReconyxHyperFire2Makernote
private void processReconyxHyperFire2Makernote(MetadataExtractor.ReconyxHyperFire2MakernoteDirectory directory, int makernoteOffset, MetadataExtractor.RandomAccessReader reader) throws java.io.IOException
- Throws:
java.io.IOException
-
processReconyxUltraFireMakernote
private void processReconyxUltraFireMakernote(MetadataExtractor.ReconyxUltraFireMakernoteDirectory directory, int makernoteOffset, MetadataExtractor.RandomAccessReader reader) throws java.io.IOException
- Throws:
java.io.IOException
-
-