无法从JPEG元数据中检索标题的全文 [英] Unable to retrieve full text of title from JPEG metadata

查看:131
本文介绍了无法从JPEG元数据中检索标题的全文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这与在Java中提取长度超过64个字符的IPTC关键字密切相关.请在那里查看我的评论.

This is closely related to Extract IPTC-Keywords Longer than 64 Chars in Java . Please see my comments there.

问题在于,在描述选项卡中作为文档标题"添加到Adobe Bridge的JPEG文件中的标题(在"Windows文件属性"对话框的详细信息"选项卡中也显示为标题")在以下两个位置处结束JPEG文件,如文件的十六进制显示所示.一个拥有完整的标题,另一个只有64个字符.

The problem is that a title added to a JPEG file in Adobe Bridge as "Document Title" in the description tab (also shown as "Title" in the Details tab of the Windows File Properties dialog) ends up in two places in the JPEG file, as can be seen in a hex display of the file. One has the full title and one has only 64 characters' worth.

我可以通过检索所有元数据目录中的所有标签描述来获取截断的一个(标签名称为对象名称"),但是我无法获得完整的标题.

I can get the truncated one (tag name "Object Name") by retrieving all the tag descriptions in all the metadata directories, but I can't get the full title.

这是一个示例文件,其嵌入标题为清晨在Waiohai海滩俱乐部和Poipu海滩公园之间的吐口水上":

Here is an example file, whose embedded title is "Early morning on the spit between Waiohai Beach Club and Poipu Beach Park":

推荐答案

我很乐意为您介绍一下.但是imgur已从该文件中删除了元数据.

I'd be happy to take a look at this for you. However imgur has stripped the metadata from that file.

您是否可以在GitHub项目上打开问题?那里的任何附加图像都不会删除元数据:

Could you open an issue on the GitHub project instead? Any attached image there won't have the metadata removed:

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

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

Please also mention whether you grant permission to use the image in the project's regression test data set.

从另一篇文章中我可以看到,您所引用的表格越长:

What I can see from your other post is that the longer form you're referencing is:

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

That string is within XMP data (as evidenced by the RDF XML surrounding it). You can access it with code resembling:

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

我仍然想看一个示例图像,但是在从十六进制编辑器中看到了屏幕截图之后,我怀疑Adobe Bridge正在将字符串截断为IPTC的64个字节.在线快速搜索表明,这是IPTC关键字字段的最大长度.

I'd still like to see a sample image, but having seen your screenshots from the hex editor, I suspect Adobe Bridge is truncating the string to 64 bytes for IPTC. A quick search online suggests that's the maximum length for the IPTC keywords field.

这篇关于无法从JPEG元数据中检索标题的全文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆