1. Reminder: Please use our affiliate links for holiday shopping!

Extract EXIF data

Discussion in 'Open Discussion' started by sprinke, Feb 29, 2012.

  1. sprinke

    sprinke Mu-43 All-Pro

    Apr 5, 2011
    Pasadena, CA
    Debi
    Has anyone heard of any script or software that can extract EXIF data IN BULK from large batches of photos?

    Here's what I'd like to do ... I have the 14-140mm lens. I'd like to make a graph of the focal length of all the pictures I've taken using that lens, to see what my preferred focal lengths are. Do I use it mostly at the wide end, the long end, somewhere in between?

    In order to do that, I need to get the EXIF data out into some kind of text file that I could open into Excel.

    It seems like it should be fairly easy to have some kind of script that could do it.
     
  2. fin azvandi

    fin azvandi Mu-43 All-Pro

    Mar 12, 2011
    South Bend, IN
    I don't know how to do what you're asking as a script, but in Aperture (maybe other image editing/management software as well?) you could probably set up smart albums with the criteria as (1) taken with the 14-140mm lens and (2) various focal lengths/ranges
     
  3. Aegon

    Aegon Mu-43 Veteran

    334
    Nov 3, 2011
    Portland, OR
    I did this a while back using exiftool.

    Some results are shown below. The first graph shows usage from a 50-135mm lens, the second shows aperture usage for all photos shot during a time period.
     

    Attached Files:

  4. sprinke

    sprinke Mu-43 All-Pro

    Apr 5, 2011
    Pasadena, CA
    Debi
  5. sprinke

    sprinke Mu-43 All-Pro

    Apr 5, 2011
    Pasadena, CA
    Debi
    How did you use ExifTool to make those graphs? That's exactly what I want.
     
  6. Aegon

    Aegon Mu-43 Veteran

    334
    Nov 3, 2011
    Portland, OR
    First, exiftool can be compiled for any platform. I happened to use a Mac, but you can use whatever.
    Second, what is your level of computer skill? Here are some pertinent questions:
    • are you familiar with the command line?
    • have you used the second OS X install CD to add the common CLI tools?
    • are you familiar with tools such as "grep" and "find"?
    • have you compiled exiftool?

    Nothing here is magic, but if you happen to be CLI literate then I can explain broadly, and if not then it will take more time.

    To cut to the chase:
    find . -name "*.PEF" -print0 | xargs -0 exiftool -focalLength -if '$lensType eq "smc PENTAX-DA* 50-135mm F2.8 ED [IF] SDM"' | grep -v "PEF" | sort -k4 -g | uniq -c

    *another edit*
    The above command looks dense, but it isn't terribly hard and anyone can do it. Some people will see the command and need no further help. If you want help, ask. I find this topic interesting and fun, so don't hold back.
     
    • Like Like x 1
  7. Squidz

    Squidz Mu-43 Regular

    38
    Feb 8, 2012
    Red Deer, Alberta
    There's Exposure Plot as well. Not sure about operation on Macs though.
     
  8. panyuser

    panyuser Mu-43 Regular

    47
    Dec 22, 2011
    I just whipped up a quick line of code to do this for you. I assume you have exiftool installed, so that opening Terminal.app (in /Applications/Utilities I think) on your Mac and entering "exiftool -h [ENTER]" does something.

    If you don't have it installed, either use their package or install it through Homebrew ("brew install exiftool" on the command line).

    Once it's installed and working, change to the directory that your files are in. If you're unsure how to do this, I suggest typing "cd " in the terminal window (but not pressing enter, just leaving a space), and then finding the folder in the Finder, and dragging the folder icon in the top bar of the Finder window (in the center, same row as the traffic light buttons) to the terminal window. This will add the directory path. Then just press enter in the terminal.

    Once in the correct directory, run this:

    Code:
    exiftool -focalLength *.jpg | awk 'BEGIN{ORS=""}/^Focal Length/{print $4","}' > focal-lengths.txt
    (This assumes the files are all named *.jpg, but you could write *.jpg *.cr2 or something too.) You should now have a file, focal-length.txt, in that directory, with the focal lengths separated by commas. Open Excel, or any spreadsheet program, and import this file (perhaps as a CSV file?) with the field separator set to a comma. Then just make the graph as I assume you know how, in Excel.
     
    • Like Like x 1
  9. sprinke

    sprinke Mu-43 All-Pro

    Apr 5, 2011
    Pasadena, CA
    Debi
    Thanks everyone, this is awesome. I can't wait to get home and try it out.

    Yes, I'm somewhat familiar with the unix command line, developer tools, etc., but I'm not a programmer really.
     
  10. bryan

    bryan Mu-43 Regular

    34
    Feb 27, 2012
    Another option for you: PhotoGrok

    This is a JWS GUI to ExifTool (runs on Mac, Linux, Windows). It doesn't do graphing as you originally requested, but you can use it to bulk search images based on EXIF metadata; you could use the search results to quickly get a feel for trends interactively.