【问题标题】:Is there a way to read/write XMP metadata using imagemagick?有没有办法使用 imagemagick 读取/写入 XMP 元数据?
【发布时间】:2014-08-15 02:49:42
【问题描述】:

我想在 JPEG 和 PNG 文件中读取/写入 XMP 元数据。

我可以使用exiftool 来做到这一点

~ $ exiftool -xmp-dc:description="FooBar" sample.png
    1 image files updated
~ $ exiftool sample.png | grep "Description"
Description                     : FooBar

但是,我无法使用 imagemagick 读取 XMP 元数据

~ $ identify -verbose sample.png | grep "Description"

我编写 XMP 元数据的原因是它可以被 Adob​​e 产品读取。

问题

  • 有没有办法使用 imagemagick 读取/写入 XMP 元数据?

【问题讨论】:

标签: imagemagick metadata xmp exiftool


【解决方案1】:

您想问的是“ImageMagick 是否支持读取或写入 XMP(描述性)元数据?”。从阅读the documentation 来看,该问题的答案是否定的。 ImageMagick 读取(几乎)文件中的所有元数据,但不读取描述性元数据。

如果由于某种原因您必须使用 ImageMagick 来提取 XMP 元数据,您可以尝试包含一个过滤器。 Filters can be configured 处理图像文件,但它们不是 ImageMagick 本身的一部分。

【讨论】:

    【解决方案2】:

    转换 -ping yourimage.jpg XMP:-

    【讨论】:

      【解决方案3】:

      访问 XMP 数据的方法如下:

      ImageMagick.XmpProfile xmp = image.GetXmpProfile();
      
      Console.WriteLine("\n\n----> xmp:" + xmp);
      if (xmp != null)
      {
          you have to process the XML data of the XMPs result.  
          ie. use XPATH or some other XML interface.
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-04-08
        • 2019-04-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-10-02
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多