Package gov.nih.mipav.model.file
Class MetadataExtractor.IptcReader
- java.lang.Object
-
- gov.nih.mipav.model.file.MetadataExtractor.IptcReader
-
- All Implemented Interfaces:
MetadataExtractor.JpegSegmentMetadataReader
- Enclosing class:
- MetadataExtractor
public class MetadataExtractor.IptcReader extends java.lang.Object implements MetadataExtractor.JpegSegmentMetadataReader
Decodes IPTC binary data, populating aMetadataExtractor.Metadata
object with tag values in anMetadataExtractor.IptcDirectory
.http://www.iptc.org/std/IIM/4.1/specification/IIMV4.1.pdf
- Author:
- Drew Noakes https://drewnoakes.com
-
-
Field Summary
Fields Modifier and Type Field Description private static byte
IptcMarkerByte
-
Constructor Summary
Constructors Constructor Description IptcReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
extract(MetadataExtractor.SequentialReader reader, MetadataExtractor.Metadata metadata, long length)
Performs the IPTC data extraction, adding found values to the specified instance ofMetadataExtractor.Metadata
.void
extract(MetadataExtractor.SequentialReader reader, MetadataExtractor.Metadata metadata, long length, MetadataExtractor.Directory parentDirectory)
Performs the IPTC data extraction, adding found values to the specified instance ofMetadataExtractor.Metadata
.java.lang.Iterable<MetadataExtractor.JpegSegmentType>
getSegmentTypes()
Gets the set of JPEG segment types that this reader is interested in.private void
processTag(MetadataExtractor.SequentialReader reader, MetadataExtractor.Directory directory, int directoryType, int tagType, int tagByteCount)
void
readJpegSegments(java.lang.Iterable<byte[]> segments, MetadataExtractor.Metadata metadata, MetadataExtractor.JpegSegmentType segmentType)
Extracts metadata from all instances of a particular JPEG segment type.
-
-
-
Field Detail
-
IptcMarkerByte
private static final byte IptcMarkerByte
- 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.
-
extract
public void extract(MetadataExtractor.SequentialReader reader, MetadataExtractor.Metadata metadata, long length)
Performs the IPTC data extraction, adding found values to the specified instance ofMetadataExtractor.Metadata
.
-
extract
public void extract(MetadataExtractor.SequentialReader reader, MetadataExtractor.Metadata metadata, long length, MetadataExtractor.Directory parentDirectory)
Performs the IPTC data extraction, adding found values to the specified instance ofMetadataExtractor.Metadata
.
-
processTag
private void processTag(MetadataExtractor.SequentialReader reader, MetadataExtractor.Directory directory, int directoryType, int tagType, int tagByteCount) throws java.io.IOException
- Throws:
java.io.IOException
-
-