Package com.drew.metadata.xmp
Class XmpReader
- java.lang.Object
-
- com.drew.metadata.xmp.XmpReader
-
- All Implemented Interfaces:
JpegSegmentMetadataReader
public class XmpReader extends java.lang.Object implements JpegSegmentMetadataReader
Extracts XMP data from JPEG APP1 segments.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'sXMPMeta
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.
-
-
Constructor Summary
Constructors Constructor Description XmpReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 ofMetadata
.void
extract(byte[] xmpBytes, Metadata metadata)
Performs the XMP data extraction, adding found values to the specified instance ofMetadata
.void
extract(byte[] xmpBytes, Metadata metadata, Directory parentDirectory)
Performs the XMP data extraction, adding found values to the specified instance ofMetadata
.void
extract(StringValue xmpString, Metadata metadata)
Performs the XMP data extraction, adding found values to the specified instance ofMetadata
.void
extract(java.lang.String xmpString, Metadata metadata)
Performs the XMP data extraction, adding found values to the specified instance ofMetadata
.void
extract(java.lang.String xmpString, Metadata metadata, Directory parentDirectory)
Performs the XMP data extraction, adding found values to the specified instance ofMetadata
.java.lang.Iterable<JpegSegmentType>
getSegmentTypes()
Gets the set of JPEG segment types that this reader is interested in.void
readJpegSegments(java.lang.Iterable<byte[]> segments, Metadata metadata, JpegSegmentType segmentType)
Version specifically for dealing with XMP found in JPEG segments.
-
-
-
Method Detail
-
getSegmentTypes
public java.lang.Iterable<JpegSegmentType> getSegmentTypes()
Description copied from interface:JpegSegmentMetadataReader
Gets the set of JPEG segment types that this reader is interested in.- Specified by:
getSegmentTypes
in interfaceJpegSegmentMetadataReader
-
readJpegSegments
public void readJpegSegments(java.lang.Iterable<byte[]> segments, Metadata metadata, JpegSegmentType segmentType)
Version specifically for dealing with XMP found in JPEG segments. This form of XMP has a peculiar preamble, which must be removed before parsing the XML.- Specified by:
readJpegSegments
in interfaceJpegSegmentMetadataReader
- Parameters:
segments
- The byte array from which the metadata should be extracted.metadata
- TheMetadata
object into which extracted values should be merged.segmentType
- TheJpegSegmentType
being read.
-
extract
public void extract(byte[] xmpBytes, Metadata metadata)
Performs the XMP data extraction, adding found values to the specified instance ofMetadata
.The extraction is done with Adobe's XMPCore library.
-
extract
public void extract(byte[] xmpBytes, Metadata metadata, Directory parentDirectory)
Performs the XMP data extraction, adding found values to the specified instance ofMetadata
.The extraction is done with Adobe's XMPCore library.
-
extract
public void extract(byte[] xmpBytes, int offset, int length, Metadata metadata, Directory parentDirectory)
Performs the XMP data extraction, adding found values to the specified instance ofMetadata
.The extraction is done with Adobe's XMPCore library.
-
extract
public void extract(java.lang.String xmpString, Metadata metadata)
Performs the XMP data extraction, adding found values to the specified instance ofMetadata
.The extraction is done with Adobe's XMPCore library.
-
extract
public void extract(StringValue xmpString, Metadata metadata)
Performs the XMP data extraction, adding found values to the specified instance ofMetadata
.The extraction is done with Adobe's XMPCore library.
-
-