5

I would like to read/write XMP metadata in JPEG and PNG files.

I'm able to do this using the exiftool

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

However, I'm not able to read the XMP Metadata using imagemagick

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

My reason to write XMP metadata is that so it can be read by Adobe Products.

Question

  • Is there a way to read/write XMP metadata using imagemagick?
StarGeek
  • 4,948
  • 2
  • 19
  • 30
Anthony
  • 33,838
  • 42
  • 169
  • 278
  • Off topic, but compatibility with Adobe products isn't the only reason to want to manipulate XMP metadata. http://www.metadataworkinggroup.org/pdf/mwg_guidance.pdf – asp Jun 29 '15 at 23:41
  • png doesn't support metadata --> http://stackoverflow.com/questions/9542359/does-png-contain-exif-data-like-jpg – Eric Kirchner Jul 14 '15 at 08:19
  • That's only with regards to EXIF metadata (though Exiftool and Exiv2 have a workaround). PNG does support XMP metadata https://en.wikipedia.org/wiki/Extensible_Metadata_Platform#Location_in_file_types *Edit:* Bah, didn't check the dates – StarGeek Oct 20 '16 at 05:19

3 Answers3

1

What you want to ask is "does ImageMagick support reading or writing XMP (descriptive) metadata?". The answer to that question, from reading the documentation, is no. ImageMagick reads (almost) all metadata from a file, but not descriptive metadata.

If for some reason you must use ImageMagick to extract XMP metadata, you could try to include a filter. Filters can be configured to process image files, but they are not part of ImageMagick itself.

Ben Companjen
  • 1,417
  • 10
  • 24
1

convert -ping yourimage.jpg XMP:-

jento
  • 39
  • 2
0

Access XMP data can be done as follows:

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.
}
Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
Mark
  • 78
  • 6