public class XmpReader extends java.lang.Object implements JpegSegmentMetadataReader
Note that XMP uses a namespace and path format for identifying values, which does not map to metadata-extractor's
integer based tag identifiers. Therefore, XMP data is extracted and exposed via XmpDirectory.getXMPMeta()
which returns an instance of Adobe's XMPMeta
which exposes the full XMP data set.
The extraction is done with Adobe's XmpCore-Library (XMP-Toolkit) Copyright (c) 1999 - 2007, Adobe Systems Incorporated All rights reserved.
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ATTRIBUTE_EXTENDED_XMP |
private static int |
EXTENDED_XMP_GUID_LENGTH
Extended XMP constants
|
private static int |
EXTENDED_XMP_INT_LENGTH |
private static java.lang.String |
SCHEMA_XMP_NOTES |
private static java.lang.String |
XMP_EXTENSION_JPEG_PREAMBLE |
private static java.lang.String |
XMP_JPEG_PREAMBLE |
Constructor and Description |
---|
XmpReader() |
Modifier and Type | Method and Description |
---|---|
void |
extract(byte[] xmpBytes,
int offset,
int length,
Metadata metadata,
Directory parentDirectory)
Performs the XMP data extraction, adding found values to the specified instance of
Metadata . |
void |
extract(byte[] xmpBytes,
Metadata metadata)
Performs the XMP data extraction, adding found values to the specified instance of
Metadata . |
void |
extract(byte[] xmpBytes,
Metadata metadata,
Directory parentDirectory)
Performs the XMP data extraction, adding found values to the specified instance of
Metadata . |
void |
extract(java.lang.String xmpString,
Metadata metadata)
Performs the XMP data extraction, adding found values to the specified instance of
Metadata . |
void |
extract(java.lang.String xmpString,
Metadata metadata,
Directory parentDirectory)
Performs the XMP data extraction, adding found values to the specified instance of
Metadata . |
void |
extract(StringValue xmpString,
Metadata metadata)
Performs the XMP data extraction, adding found values to the specified instance of
Metadata . |
private static java.lang.String |
getExtendedXMPGUID(Metadata metadata)
Determine if there is an extended XMP section based on the standard XMP part.
|
java.lang.Iterable<JpegSegmentType> |
getSegmentTypes()
Gets the set of JPEG segment types that this reader is interested in.
|
private static byte[] |
processExtendedXMPChunk(Metadata metadata,
byte[] segmentBytes,
java.lang.String extendedXMPGUID,
byte[] extendedXMPBuffer)
Process an Extended XMP chunk.
|
void |
readJpegSegments(java.lang.Iterable<byte[]> segments,
Metadata metadata,
JpegSegmentType segmentType)
Version specifically for dealing with XMP found in JPEG segments.
|
private static final java.lang.String XMP_JPEG_PREAMBLE
private static final java.lang.String XMP_EXTENSION_JPEG_PREAMBLE
private static final java.lang.String SCHEMA_XMP_NOTES
private static final java.lang.String ATTRIBUTE_EXTENDED_XMP
private static final int EXTENDED_XMP_GUID_LENGTH
private static final int EXTENDED_XMP_INT_LENGTH
public java.lang.Iterable<JpegSegmentType> getSegmentTypes()
JpegSegmentMetadataReader
getSegmentTypes
in interface JpegSegmentMetadataReader
public void readJpegSegments(java.lang.Iterable<byte[]> segments, Metadata metadata, JpegSegmentType segmentType)
readJpegSegments
in interface JpegSegmentMetadataReader
segments
- The byte array from which the metadata should be extracted.metadata
- The Metadata
object into which extracted values should be merged.segmentType
- The JpegSegmentType
being read.public void extract(byte[] xmpBytes, Metadata metadata)
Metadata
.
The extraction is done with Adobe's XMPCore library.
public void extract(byte[] xmpBytes, Metadata metadata, Directory parentDirectory)
Metadata
.
The extraction is done with Adobe's XMPCore library.
public void extract(byte[] xmpBytes, int offset, int length, Metadata metadata, Directory parentDirectory)
Metadata
.
The extraction is done with Adobe's XMPCore library.
public void extract(java.lang.String xmpString, Metadata metadata)
Metadata
.
The extraction is done with Adobe's XMPCore library.
public void extract(StringValue xmpString, Metadata metadata)
Metadata
.
The extraction is done with Adobe's XMPCore library.
public void extract(java.lang.String xmpString, Metadata metadata, Directory parentDirectory)
Metadata
.
The extraction is done with Adobe's XMPCore library.
private static java.lang.String getExtendedXMPGUID(Metadata metadata)
private static byte[] processExtendedXMPChunk(Metadata metadata, byte[] segmentBytes, java.lang.String extendedXMPGUID, byte[] extendedXMPBuffer)