I am absolutely not intending to buy a nice lens to replace my bog standard 18-55mm kit lens. Not at all. But I am doing the research for one because, you know, that’s where most of the fun’s to be had. And so one question I need to answer is: What is the focal length I tend to use on my photos? Because that will dictate the focal length (or range) of what I should be shopping for. Do I do lots of wide angle shots? Close-ups? How close up?
How to find out?
My answer was follows:
- Select all 4-star photos. These are the good ones; I’m not interested in data from the photos that didn’t make the grade. The focal length used in each photo is embedded in the Exif data in the JPEG file. Currently these photos are on Windows in Lightroom.
- Export said photos to a directory on a Linux box.
- SSH to the Linux box and go to the directory with the photos.
- apt-get install exiv2. (“exiv2 is a program to read and write Exif and IPTC image metadata and image comments”, says the man page.)
- Run the following pipeline:
exiv2 *.jpg | grep 'Focal length' | sed -e 's/ */ /g' | cut -d ' ' -f 5 > focal-lengths.csv
This extracts just focal length data into a CSV file.
- Back on Windows open up the CSV file in Excel.
- Perform Excel-fu to get a chart of the focal lengths. In my case I rounded them down to the nearest 5mm to get a clearer picture.
And that, my friends, is shopping.