post: | EXIF Statistics | mod: |
02.Sep.09 | 02.Sep.09 |
Finally I got around writing a little sniplet to fetch some EXIF Statistics. By using the
Image::ExifTool
Perl library this script is little more than a histogram generating filter. For those of you looking for something similar here are the most important code lines.
GetAllInSub($path);
foreach(@AllPics) {
my $EXIF = $exifTool->ImageInfo($_);
if(defined $$EXIF{$EXIF_key}) {
$nHisto{$$EXIF{$EXIF_key}}++;
}
}
The loop above will generate the histogram. For fetching the images I use this little routine:
sub GetAllInSub {
my $dir = shift;
opendir DIR, $dir or return;
my @contents = map "$dir/$_", sort grep !/^\.\.?$/, readdir DIR;
closedir DIR;
foreach (@contents) {
&GetAllInSub($_);
if($_=~m/^.*?[NEF,JPG]$/) {
push(@AllPics,"$_\n");
}
}
}
Dropping the generated results into Numbers (or such), you can generate all the graphics you like. Below you can see the focal lengths I used in the last 4 years.