2

这与Extract IPTC-Keywords Longer than 64 Chars in Java密切相关。请在那里查看我的评论。

问题是在 Adob​​e Bridge 中添加到 JPEG 文件的标题在描述选项卡中作为“文档标题”(在 Windows 文件属性对话框的详细信息选项卡中也显示为“标题”)在 JPEG 文件中的两个位置结束,可以在文件的十六进制显示中看到。一个有完整的标题,一个只有 64 个字符的价值。

我可以通过检索所有元数据目录中的所有标签描述来获得截断的(标签名称“对象名称”),但我无法获得完整的标题。

这是一个示例文件,其嵌入的标题是“清晨在外海海滩俱乐部和波伊普海滩公园之间的吐痰”:

带有元数据的示例文件

4

1 回答 1

1

我很乐意为你看看这个。但是 imgur 已经从该文件中删除了元数据。

你能在 GitHub 项目上打开一个问题吗?那里的任何附加图像都不会删除元数据:

https://github.com/drewnoakes/metadata-extractor/issues/new

还请提及您是否授予在项目的回归测试数据集中使用图像的权限。


我从您的另一篇文章中可以看出,您引用的较长形式是:

该字符串在 XMP 数据中(由围绕它的 RDF XML 证明)。您可以使用类似以下的代码访问它:

// Extract metadata from the image
Metadata metadata = ImageMetadataReader.readMetadata(image);

// 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();

    // Iterate XMP properties
    XMPIterator itr = xmpMeta.iterator();
    while (itr.hasNext()) {
        XMPPropertyInfo property = (XMPPropertyInfo) itr.next();

        // Print details of the property
        System.out.println(property.getPath() + ": " + property.getValue());
    }
}

我仍然希望看到一个示例图像,但是从十六进制编辑器中看到了您的屏幕截图,我怀疑 Adob​​e Bridge 正在将字符串截断为 64 字节以用于 IPTC。在线快速搜索表明这是 IPTC 关键字字段的最大长度。

于 2016-10-09T21:08:54.967 回答