Tuesday, April 8, 2008

What lens do I need? How to use EXIFTOOL to find out

My trusty Nikon D70 and two lenses (kit 18-70 and Tokina 12-24) have been plenty of places with me, and I'm curious to know if I should continue using them when I get my D300, or if I should consider getting a different lens, say the fabulous Nikon 17-55.

To do this, we can use EXIFTool to extract camera model and focal length information for lots of photos, and then apply some analysis to the result.

First you need to see which EXIF fields you need. To do this run (NB lines may wrap)

exiftool -a -G1 -s 'IMG_4107_Wheat_&_Olives.jpg' >all_tags.txt

from which I can see that I need to extract '
FocalLength' and 'Mode'

so my next command to check is

exiftool -FocalLength -Model DSC_2671_Salt_Flats_2.jpg

gives

Focal Length : 44.0 mm
Camera Model Name : NIKON D70

An alternative field would be 'FocalLength35efl' which gives the 35mm equivalent. Handily this field seems to be present in both my Canon files and my Nikon files.

exiftool -FocalLength -Model -FocalLength35efl DSC_2671_Salt_Flats_2.jpg

gives

Focal Length : 44.0 mm

Camera Model Name : NIKON D70
Focal Length : 44.0 mm (35 mm equivalent: 66.0 mm)

So now I need to run this on a directory, and recurse through the various folders and put the result into a file.

exiftool -FocalLength -Model -FocalLength35efl -r ~/pictures >big_extract.txt

Now I can take this file, put the fields onto the same line for each photo, grep out pictures not taken by me, cameras I'm not interested in eg my Nokia N73 and Olympus C2020Z, and separate the fields I want with commas.

After that I will put the file into OpenOffice and run the analysis. Thats the next tutorial.

No comments: