Werzi2001
Werzi2001

Reputation: 2135

Extract EXIF data as text using ImageMagick

Is there a simple way to extract EXIF data as text from an image file using ImageMagick. Something like the way to do it for IPTC data:

convert input.jpeg data.iptc <= binary data
convert input.jpeg data.iptctext <= textual data

Sadly this doesn't work for EXIF data:

convert input.jpeg data.exif <= binary data
convert input.jpeg data.exiftext <= not working

I know that i can use

identify -verbose input.jpeg

but then i would have to parse the result in order to search for all the EXIF and IPTC data.

So is there a simple way to do it with pure ImageMagick?

Upvotes: 55

Views: 40343

Answers (2)

gavenkoa
gavenkoa

Reputation: 48813

The syntax for graphicmagic is:

gm identify -format '%[EXIF:*]' my.jpeg

Upvotes: 0

Mark Setchell
Mark Setchell

Reputation: 207485

Like this:

identify -format '%[EXIF:*]' image.jpg

Output:

exif:ApertureValue=4845/1918
exif:BrightnessValue=4991/792
exif:ColorSpace=1
exif:ComponentsConfiguration=1, 2, 3, 0
exif:Compression=6
exif:DateTime=2014:08:31 14:18:07
exif:DateTimeDigitized=2014:08:31 14:18:07
exif:DateTimeOriginal=2014:08:31 14:18:07
exif:ExifImageLength=2448
exif:ExifImageWidth=3264
exif:ExifOffset=204
exif:ExifVersion=48, 50, 50, 49
...
...

Upvotes: 71

Related Questions