Package gov.nih.mipav.model.file
Class MetadataExtractor.ExifReader
- java.lang.Object
-
- gov.nih.mipav.model.file.MetadataExtractor.ExifReader
-
- All Implemented Interfaces:
MetadataExtractor.JpegSegmentMetadataReader
- Enclosing class:
- MetadataExtractor
public class MetadataExtractor.ExifReader extends java.lang.Object implements MetadataExtractor.JpegSegmentMetadataReader
Decodes Exif binary data, populating aMetadataExtractor.Metadata
object with tag values inMetadataExtractor.ExifSubIFDDirectory
,MetadataExtractor.ExifThumbnailDirectory
,MetadataExtractor.ExifInteropDirectory
,MetadataExtractor.GpsDirectory
and one of the many camera makernote directories.- Author:
- Drew Noakes https://drewnoakes.com
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
JPEG_SEGMENT_PREAMBLE
Exif data stored in JPEG files' APP1 segment are preceded by this six character preamble "Exif\0\0".
-
Constructor Summary
Constructors Constructor Description ExifReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
extract(MetadataExtractor.RandomAccessReader reader, MetadataExtractor.Metadata metadata)
Reads TIFF formatted Exif data from start of the specifiedMetadataExtractor.RandomAccessReader
.void
extract(MetadataExtractor.RandomAccessReader reader, MetadataExtractor.Metadata metadata, int readerOffset)
Reads TIFF formatted Exif data a specified offset within aMetadataExtractor.RandomAccessReader
.void
extract(MetadataExtractor.RandomAccessReader reader, MetadataExtractor.Metadata metadata, int readerOffset, MetadataExtractor.Directory parentDirectory)
Reads TIFF formatted Exif data at a specified offset within aMetadataExtractor.RandomAccessReader
.java.lang.Iterable<MetadataExtractor.JpegSegmentType>
getSegmentTypes()
Gets the set of JPEG segment types that this reader is interested in.void
readJpegSegments(java.lang.Iterable<byte[]> segments, MetadataExtractor.Metadata metadata, MetadataExtractor.JpegSegmentType segmentType)
Extracts metadata from all instances of a particular JPEG segment type.boolean
startsWithJpegExifPreamble(byte[] bytes)
Indicates whether 'bytes' starts with 'JpegSegmentPreamble'.
-
-
-
Field Detail
-
JPEG_SEGMENT_PREAMBLE
public static final java.lang.String JPEG_SEGMENT_PREAMBLE
Exif data stored in JPEG files' APP1 segment are preceded by this six character preamble "Exif\0\0".- See Also:
- Constant Field Values
-
-
Method Detail
-
getSegmentTypes
public java.lang.Iterable<MetadataExtractor.JpegSegmentType> getSegmentTypes()
Description copied from interface:MetadataExtractor.JpegSegmentMetadataReader
Gets the set of JPEG segment types that this reader is interested in.- Specified by:
getSegmentTypes
in interfaceMetadataExtractor.JpegSegmentMetadataReader
-
readJpegSegments
public void readJpegSegments(java.lang.Iterable<byte[]> segments, MetadataExtractor.Metadata metadata, MetadataExtractor.JpegSegmentType segmentType)
Description copied from interface:MetadataExtractor.JpegSegmentMetadataReader
Extracts metadata from all instances of a particular JPEG segment type.- Specified by:
readJpegSegments
in interfaceMetadataExtractor.JpegSegmentMetadataReader
- Parameters:
segments
- A sequence of byte arrays from which the metadata should be extracted. These are in the order encountered in the original file.metadata
- TheMetadataExtractor.Metadata
object into which extracted values should be merged.segmentType
- TheMetadataExtractor.JpegSegmentType
being read.
-
startsWithJpegExifPreamble
public boolean startsWithJpegExifPreamble(byte[] bytes)
Indicates whether 'bytes' starts with 'JpegSegmentPreamble'.
-
extract
public void extract(MetadataExtractor.RandomAccessReader reader, MetadataExtractor.Metadata metadata)
Reads TIFF formatted Exif data from start of the specifiedMetadataExtractor.RandomAccessReader
.
-
extract
public void extract(MetadataExtractor.RandomAccessReader reader, MetadataExtractor.Metadata metadata, int readerOffset)
Reads TIFF formatted Exif data a specified offset within aMetadataExtractor.RandomAccessReader
.
-
extract
public void extract(MetadataExtractor.RandomAccessReader reader, MetadataExtractor.Metadata metadata, int readerOffset, MetadataExtractor.Directory parentDirectory)
Reads TIFF formatted Exif data at a specified offset within aMetadataExtractor.RandomAccessReader
.
-
-