PNG图像中支持XMP元数据吗? [英] Is XMP metadata supported in PNG images?

查看:625
本文介绍了PNG图像中支持XMP元数据吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在过去的几个小时中,我一直在尝试了解XMP元数据如何处理PNG文件,但是我对此不太了解.

I've been trying to understand how XMP metadata worked on PNG files for the last few hours but couldn't quite wrap my head around it.

如果我使用Photoshop创建PNG图像,将其保存并打开文件信息"对话框(文件">文件信息"或Ctrl + Alt + Shift + I),我会看到一些XMP属性,例如CreateDateCreatorToolModifyDate.

If I create a PNG image with Photoshop, save it and open the File Info dialog (File > File Info or Ctrl+Alt+Shift+I), I can see some XMP properties like CreateDate, CreatorTool or ModifyDate.

现在,如果我尝试使用exiv2打开文件并读取元数据,似乎什么都找不到:

Now if I try to open the file with exiv2 and read the metadata it seems to not find anything:

auto image = Exiv2::ImageFactory::open(imagePath);
image->readMetadata();
Exiv2::XmpData &xmpData = image->xmpData();

exiftool -xmp:all myImage.pngexiv2 -P X myImage.png甚至GIMP也是如此(但我认为它是

The same goes with the exiftool -xmp:all myImage.png, exiv2 -P X myImage.png, or even GIMP (but I think it is using exiv2 internally).

如果在用Photoshop再次保存时未删除任何添加的元数据,这将不是问题.如果不清楚,请打开图像并使用exiv2添加XMP元数据,然后将其保存,在Photoshop和文件信息对话框中重新打开图像,以前添加的属性就不存在了.

This wouldn't be such an issue if any added metadata were not removed when saving again with Photoshop. In case this wasn't clear, opening the image and adding XMP metadata with exiv2, saving it, opening the image back in Photoshop and in the file info dialog, the properties added previously are not there any more.

奇怪的是,如果您使用JPEG图像完成整个过程,那么一切都会按预期进行:所有属性都可以从Photoshop和exiv2中看到,并且如果我尝试使用exiv2添加元数据(使用相同的代码),它也会出现在Photoshop中.

The weird thing is that if you do this entire process with a JPEG image, everything works as expected: all the properties are visible from both Photoshop and exiv2 and if I try to add metadata with exiv2 (using the same code), it appears in Photoshop as well.

我缺少明显的东西吗?关于PNG,JPEG有什么不对的地方吗?我没有尝试使用 Adob​​e的SDK 来编辑XMP数据吗?更好的?

Am I missing something obvious? Is there anything special about PNGs that is not true for JPEGs? I haven't tried to use Adobe's SDK to edit the XMP data, is it any better?

任何帮助将不胜感激,因为这开始让我发疯:/

Any help would be much appreciated as this is starting to drive me crazy :/

阅读这篇文章后,我尝试使用Adobe Bridge,但它似乎没有显示与以下内容相同的属性Photoshop.如果我在Exiv2中添加XMP元数据,它们将显示在Bridge中,但是如果我在Photoshop中修改图像,则元数据将再次从Bridge中消失.

After reading this post I tried with Adobe Bridge and it doesn't seem to display the same properties as Photoshop. If I add XMP metadata with Exiv2 they are displayed in Bridge but if I modify the image in Photoshop, the metadata is gone from Bridge again.

推荐答案

对,我终于得到了一份Photoshop CC副本,一切正常.一定是CS5和CS6中的错误,并且已在CC中得到纠正.

Right, I finally got my hands on a copy of Photoshop CC and everything works fine. It must have been a bug in CS5 and CS6 that has been corrected in CC.

我认为Photoshop CS6(13.1?)的最新更新解决了此问题. PNG图像中的ICC颜色配置文件似乎也已解决问题: http://forums.adobe.com /thread/1183489

I think a recent update of Photoshop CS6 (13.1?) fixed this issue. It seems to have fixed problems with ICC color profiles in PNG images as well: http://forums.adobe.com/thread/1183489

这篇关于PNG图像中支持XMP元数据吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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