Search code examples
imagemagickexif

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?


Solution

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