drewnoakes / metadata-extractor

Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Apache License 2.0
2.54k stars 478 forks source link

Support for Illustrator files #224

Open markwoon opened 7 years ago

markwoon commented 7 years ago

Would it be possible to add support for Illustrator (.ai) files?

drewnoakes commented 7 years ago

Anything is possible :)

Do you have a reference for the file format? Is it similar to #120?

https://en.wikipedia.org/wiki/Adobe_Illustrator_Artwork

Can you make a pull request?

markwoon commented 7 years ago

I don't think current .ai files are EPS based. If anything, they're PDF based.

Do you have any code that can extract XMP data from a binary file?

drewnoakes commented 7 years ago

A quick read suggests they're either EPS or PDF. Seems one's more popular nowadays.

We use Adobe's XMPCore project to convert XMP data into an object model. Code that reliably identifies this XMP within the containing file and forwards it for processing to XMPCore would be a good fit for this library. Take a look at XmpDirectory and its usages throughout the library. We extract XMP from JPEG, PNG and so forth.

markwoon commented 6 years ago

@drewnoakes I don't know about "realiably identifies XMP within the containing file", but this works for me: https://gist.github.com/markwoon/5b216226363859fd1a39dc091f43eca7