4

Is there a way to extract EXIF information of all images within a directory (into an output file)? Preferably I also need GPS data but this is not essential.

I only ask, as I have a number of directories with a large number of image files within, so automating the EXIF extraction would be useful.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
davidbain
  • 143
  • 4
  • 1
    Do you need something more elaborate than for example `for file in *.jpg; do echo "=== ${file} ===" >> outputfile; exiv2 "${file}" >> outputfile; done`? Or `find . -type f -name '*.jpg' -exec exiv2 '{}' ';' > outputfile` (though that, as is, might not include the image file names; it should be easy to adapt, though)? – user Dec 03 '13 at 10:27
  • I'll give this a go, will modify it to include file names. Thanks for the response! – davidbain Dec 03 '13 at 10:53

3 Answers3

4

With exiftool:

exiftool -r . > exif.txt

(remove the -r if you didn't intend to recurse into sub-directories).

Note that GPS data usually is in EXIF tags.

Stéphane Chazelas
  • 522,931
  • 91
  • 1,010
  • 1,501
1

You can use jhead to do this.

You can do a loop to parse each file, then grep the pattern you need.

Vinz
  • 2,120
  • 12
  • 16
0

Along the same lines as exiftool there's also exiv2. Works similarly from the command line.

$ exiv2 *.jpg > exifs.txt

It lacks a recursive switch so you'd need to use a find command to walk it through a directory tree of image files.

slm
  • 363,520
  • 117
  • 767
  • 871