本文整理汇总了Java中com.adobe.xmp.properties.XMPPropertyInfo类的典型用法代码示例。如果您正苦于以下问题:Java XMPPropertyInfo类的具体用法?Java XMPPropertyInfo怎么用?Java XMPPropertyInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XMPPropertyInfo类属于com.adobe.xmp.properties包,在下文中一共展示了XMPPropertyInfo类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getXmpProperties
import com.adobe.xmp.properties.XMPPropertyInfo; //导入依赖的package包/类
/**
* Gets a map of all XMP properties in this directory.
* <p>
* This is required because XMP properties are represented as strings, whereas the rest of this library
* uses integers for keys.
*/
@NotNull
public Map<String, String> getXmpProperties()
{
Map<String, String> propertyValueByPath = new HashMap<String, String>();
if (_xmpMeta != null)
{
try {
for (Iterator i = _xmpMeta.iterator(); i.hasNext(); ) {
XMPPropertyInfo prop = (XMPPropertyInfo)i.next();
String path = prop.getPath();
String value = prop.getValue();
if (path != null && value != null) {
propertyValueByPath.put(path, value);
}
}
} catch (XMPException ignored) {
}
}
return Collections.unmodifiableMap(propertyValueByPath);
}
开发者ID:drewnoakes,项目名称:metadata-extractor,代码行数:29,代码来源:XmpDirectory.java
示例2: setXMPMeta
import com.adobe.xmp.properties.XMPPropertyInfo; //导入依赖的package包/类
public void setXMPMeta(@NotNull XMPMeta xmpMeta)
{
_xmpMeta = xmpMeta;
try {
int valueCount = 0;
for (Iterator i = _xmpMeta.iterator(); i.hasNext(); ) {
XMPPropertyInfo prop = (XMPPropertyInfo)i.next();
if (prop.getPath() != null) {
valueCount++;
}
}
setInt(TAG_XMP_VALUE_COUNT, valueCount);
} catch (XMPException ignored) {
}
}
开发者ID:drewnoakes,项目名称:metadata-extractor,代码行数:17,代码来源:XmpDirectory.java
示例3: parseZfData
import com.adobe.xmp.properties.XMPPropertyInfo; //导入依赖的package包/类
private static ZfMetaData parseZfData(XMPIterator it) {
ZfMetaData metaData = new ZfMetaData();
while (it.hasNext()) {
XMPPropertyInfo pi = (XMPPropertyInfo)it.next();
String path = pi.getPath();
if (Schema.URN.equals(pi.getNamespace()) && path != null) {
if (path.endsWith("ConformanceLevel")) {
metaData.setConformanceLevel(ConformanceLevel.valueOf(pi.getValue()));
}
else if (path.endsWith("DocumentFileName")) {
metaData.setDocumentFileName(pi.getValue());
}
else if (path.endsWith("DocumentType")) {
metaData.setDocumentType(DocumentType.valueOf(pi.getValue()));
}
else if (path.endsWith("Version")) {
metaData.setVersion(Version.valueOf(pi.getValue()));
}
}
}
return metaData;
}
开发者ID:opendatalab-de,项目名称:zugferd,代码行数:23,代码来源:ZfMetaDataReader.java
示例4: getExtendedXMPGUID
import com.adobe.xmp.properties.XMPPropertyInfo; //导入依赖的package包/类
/**
* Determine if there is an extended XMP section based on the standard XMP part.
* The xmpNote:HasExtendedXMP attribute contains the GUID of the Extended XMP chunks.
*/
@Nullable
private static String getExtendedXMPGUID(@NotNull Metadata metadata)
{
final Collection<XmpDirectory> xmpDirectories = metadata.getDirectoriesOfType(XmpDirectory.class);
for (XmpDirectory directory : xmpDirectories) {
final XMPMeta xmpMeta = directory.getXMPMeta();
try {
final XMPIterator itr = xmpMeta.iterator(SCHEMA_XMP_NOTES, null, null);
if (itr == null)
continue;
while (itr.hasNext()) {
final XMPPropertyInfo pi = (XMPPropertyInfo) itr.next();
if (ATTRIBUTE_EXTENDED_XMP.equals(pi.getPath())) {
return pi.getValue();
}
}
} catch (XMPException e) {
// Fail silently here: we had a reading issue, not a decoding issue.
}
}
return null;
}
开发者ID:drewnoakes,项目名称:metadata-extractor,代码行数:31,代码来源:XmpReader.java
示例5: xmpSample
import com.adobe.xmp.properties.XMPPropertyInfo; //导入依赖的package包/类
private static void xmpSample(InputStream imageStream) throws XMPException, ImageProcessingException, IOException
{
// Extract metadata from the image
Metadata metadata = ImageMetadataReader.readMetadata(imageStream);
// Iterate through any XMP directories we may have received
for (XmpDirectory xmpDirectory : metadata.getDirectoriesOfType(XmpDirectory.class)) {
// Usually with metadata-extractor, you iterate a directory's tags. However XMP has
// a complex structure with many potentially unknown properties. This doesn't map
// well to metadata-extractor's directory-and-tag model.
//
// If you need to use XMP data, access the XMPMeta object directly.
XMPMeta xmpMeta = xmpDirectory.getXMPMeta();
XMPIterator itr = xmpMeta.iterator();
// Iterate XMP properties
while (itr.hasNext()) {
XMPPropertyInfo property = (XMPPropertyInfo) itr.next();
// Print details of the property
System.out.println(property.getPath() + ": " + property.getValue());
}
}
}
开发者ID:drewnoakes,项目名称:metadata-extractor,代码行数:28,代码来源:XmpSample.java
示例6: processXmpTags
import com.adobe.xmp.properties.XMPPropertyInfo; //导入依赖的package包/类
private void processXmpTags(XmpDirectory directory, XMPMeta xmpMeta) throws XMPException
{
// store the XMPMeta object on the directory in case others wish to use it
directory.setXMPMeta(xmpMeta);
// read all the tags and send them to the directory
// I've added some popular tags, feel free to add more tags
processXmpTag(xmpMeta, directory, SCHEMA_EXIF_ADDITIONAL_PROPERTIES, "aux:LensInfo", XmpDirectory.TAG_LENS_INFO, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_EXIF_ADDITIONAL_PROPERTIES, "aux:Lens", XmpDirectory.TAG_LENS, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_EXIF_ADDITIONAL_PROPERTIES, "aux:SerialNumber", XmpDirectory.TAG_CAMERA_SERIAL_NUMBER, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_EXIF_ADDITIONAL_PROPERTIES, "aux:Firmware", XmpDirectory.TAG_FIRMWARE, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_EXIF_TIFF_PROPERTIES, "tiff:Make", XmpDirectory.TAG_MAKE, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_EXIF_TIFF_PROPERTIES, "tiff:Model", XmpDirectory.TAG_MODEL, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_EXIF_SPECIFIC_PROPERTIES, "exif:ExposureTime", XmpDirectory.TAG_EXPOSURE_TIME, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_EXIF_SPECIFIC_PROPERTIES, "exif:ExposureProgram", XmpDirectory.TAG_EXPOSURE_PROGRAM, FMT_INT);
processXmpTag(xmpMeta, directory, SCHEMA_EXIF_SPECIFIC_PROPERTIES, "exif:ApertureValue", XmpDirectory.TAG_APERTURE_VALUE, FMT_RATIONAL);
processXmpTag(xmpMeta, directory, SCHEMA_EXIF_SPECIFIC_PROPERTIES, "exif:FNumber", XmpDirectory.TAG_F_NUMBER, FMT_RATIONAL);
processXmpTag(xmpMeta, directory, SCHEMA_EXIF_SPECIFIC_PROPERTIES, "exif:FocalLength", XmpDirectory.TAG_FOCAL_LENGTH, FMT_RATIONAL);
processXmpTag(xmpMeta, directory, SCHEMA_EXIF_SPECIFIC_PROPERTIES, "exif:ShutterSpeedValue", XmpDirectory.TAG_SHUTTER_SPEED, FMT_RATIONAL);
processXmpDateTag(xmpMeta, directory, SCHEMA_EXIF_SPECIFIC_PROPERTIES, "exif:DateTimeOriginal", XmpDirectory.TAG_DATETIME_ORIGINAL);
processXmpDateTag(xmpMeta, directory, SCHEMA_EXIF_SPECIFIC_PROPERTIES, "exif:DateTimeDigitized", XmpDirectory.TAG_DATETIME_DIGITIZED);
processXmpTag(xmpMeta, directory, SCHEMA_XMP_PROPERTIES, "xmp:Rating", XmpDirectory.TAG_RATING, FMT_DOUBLE);
/*
// this requires further research
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:title", XmpDirectory.TAG_TITLE, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:subject", XmpDirectory.TAG_SUBJECT, FMT_STRING);
processXmpDateTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:date", XmpDirectory.TAG_DATE);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:type", XmpDirectory.TAG_TYPE, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:description", XmpDirectory.TAG_DESCRIPTION, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:relation", XmpDirectory.TAG_RELATION, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:coverage", XmpDirectory.TAG_COVERAGE, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:creator", XmpDirectory.TAG_CREATOR, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:publisher", XmpDirectory.TAG_PUBLISHER, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:contributor", XmpDirectory.TAG_CONTRIBUTOR, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:rights", XmpDirectory.TAG_RIGHTS, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:format", XmpDirectory.TAG_FORMAT, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:identifier", XmpDirectory.TAG_IDENTIFIER, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:language", XmpDirectory.TAG_LANGUAGE, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:audience", XmpDirectory.TAG_AUDIENCE, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:provenance", XmpDirectory.TAG_PROVENANCE, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:rightsHolder", XmpDirectory.TAG_RIGHTS_HOLDER, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:instructionalMethod", XmpDirectory.TAG_INSTRUCTIONAL_METHOD, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:accrualMethod", XmpDirectory.TAG_ACCRUAL_METHOD, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:accrualPeriodicity", XmpDirectory.TAG_ACCRUAL_PERIODICITY, FMT_STRING);
processXmpTag(xmpMeta, directory, SCHEMA_DUBLIN_CORE_SPECIFIC_PROPERTIES, "dc:accrualPolicy", XmpDirectory.TAG_ACCRUAL_POLICY, FMT_STRING);
*/
for (XMPIterator iterator = xmpMeta.iterator(); iterator.hasNext(); ) {
XMPPropertyInfo propInfo = (XMPPropertyInfo) iterator.next();
String path = propInfo.getPath();
String value = propInfo.getValue();
if (path != null && value != null)
directory.addProperty(path, value);
}
}
开发者ID:byronb92,项目名称:ImageEXIFExtraction,代码行数:61,代码来源:XmpReader.java
注:本文中的com.adobe.xmp.properties.XMPPropertyInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论