Anthony
Anthony

Reputation: 35978

Is there a way to read/write XMP metadata using imagemagick?

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

Upvotes: 5

Views: 7337

Answers (3)

Mark
Mark

Reputation: 78

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.
}

Upvotes: 0

jento
jento

Reputation: 39

convert -ping yourimage.jpg XMP:-

Upvotes: 1

Ben Companjen
Ben Companjen

Reputation: 1443

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.

Upvotes: 1

Related Questions