Extract metadata from AI/EPS-file?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
rokdzone
Posts: 8
Joined: 2015-02-11T08:29:25-07:00
Authentication code: 6789

Extract metadata from AI/EPS-file?

Post by rokdzone »

Is it possible to use Image Magick to analyze a AI/EPS-file and extract whatever metadata that is there?
We are also very interested to know if it is possible to scan an EPS-document for pantone colors (Pantone Solid Coated).

We wish do this this programmatically from PHP, but all we wish to know if it is possible.

To specify exactly what we wan't to extract:

1. Width/height of the document (or rather if it is quadratical or not)
2. Content size (if possible)
3. Colors (CMYK/or pantone)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Extract metadata from AI/EPS-file?

Post by snibgo »

"identify -verbose x.ai" will show most or all the metadata that IM can see, including colorspace (CMYK etc). This may include spot colours (but IM won't use those).

I don't know what "quadratical" means.
snibgo's IM pages: im.snibgo.com
rokdzone
Posts: 8
Joined: 2015-02-11T08:29:25-07:00
Authentication code: 6789

Re: Extract metadata from AI/EPS-file?

Post by rokdzone »

Thanks!

You don't happen how to do this with Imagick using PHP?
I've searched but can't find any information about that.

With quadratical i mean the same with/height of the document, but that is not important anyway
rokdzone
Posts: 8
Joined: 2015-02-11T08:29:25-07:00
Authentication code: 6789

Re: Extract metadata from AI/EPS-file?

Post by rokdzone »

The command "identify -verbose x.ai" returned an single dimensional array of 829 indexes.
No associative array either, just numbers, impossible to do something whith that information.

The XMP data in the AI file is well formed XML, should be possible to extract that somehow.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Extract metadata from AI/EPS-file?

Post by fmw42 »

Upload an example .ai file to some place like dropbox.com and put the URL here, so some one can check it out. Also always identify your IM version and platform when you post questions.

You should be able to extract the xmp data using -profile. See http://www.imagemagick.org/Usage/formats/#profiles
rokdzone
Posts: 8
Joined: 2015-02-11T08:29:25-07:00
Authentication code: 6789

Re: Extract metadata from AI/EPS-file?

Post by rokdzone »

Here is the file: https://drive.google.com/file/d/0B3zign ... sp=sharing
My ImageMagick version is 6.6.5-10, the platform is Windows 8 + IIS (using Imagick dll)

As for Pantone, the colors are a part of the XMP, so if you could extract the XMP you should be able to extract the pantone color names :)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Extract metadata from AI/EPS-file?

Post by snibgo »

Code: Select all

convert Bring-logo-PMS.eps x.xmp
Then search x.xmp for "PANTONE".
snibgo's IM pages: im.snibgo.com
rokdzone
Posts: 8
Joined: 2015-02-11T08:29:25-07:00
Authentication code: 6789

Re: Extract metadata from AI/EPS-file?

Post by rokdzone »

Will try this, thanx! :)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Extract metadata from AI/EPS-file?

Post by snibgo »

"identify -verbose Bring-logo-PMS.eps" also gives some PANTONE information. I haven't compared this with the XMP.
snibgo's IM pages: im.snibgo.com
Post Reply