photoname is a command-line utility for renaming/moving photo image files. The new folder location and naming are determined by two things: the photo shoot date information contained within the file's EXIF tags and the usually-camera-assigned serial number, often appearing in the filename.
photoname is written in Haskell. It's known to build under GHC 6.10.3 on systems where System.Posix (unix) packages are available. It did at one time build under GHC 6.8.3 but this hasn't been confirmed for some time. It may work. Bjorn Bringert's libexif binding library is required to build this software.
The path calculation scheme used here is admittedly specific to my needs. I welcome suggestions discussing, or patches allowing, more flexibility.
photoname's --help usage information:
Usage: photoname [OPTIONS] PARENTDIR FILES
Rename and move photo files based on EXIF data
Options:
-n --no-action Display what would be done, but do nothing
-q --quiet Suppress normal output of what's being done
--move Move the files, don't just hard-link to the new locations
-h --help This help text
This software is for renaming and storing your digital photos. It will
extract shoot date from the EXIF data in the image file and use that along
with the usually-camera-assigned serial number to build a meaningful
filename.
You get a subdirectory hierarchy consisting of directories for the years,
then subdirs within those for the day photos were shot. These day dirs
contain the image files, renamed as follows:
A photo shot on 2002-May-02 with a Canon camera:
img_1790.jpg -> <PARENTDIR>/2002/2002-05-02/20020502_790.jpg
The code is basically looking for three digits before the file extension
to use as a 'serial' number for the day's photos. This is a seemingly
common occurrance with cameras that we can pick numbers off the end of
the filename, or at least I hope that's the case. Examples of the two
that I have:
vvv (use these digits)
Panasonic: P###0###.jpg
Canon: img_####.jpg
^^^
The <PARENTDIR> is the one given on the command-line to this utility,
and represents the top-level of where you're storing photos.
Note that the default behavior of this software is to create hard links
to the new paths and leave the original links as they were. You can use
the --move switch to blow away the original location, leaving only the new.
Version 2.2 2009-Jun-07 Dino Morelli <dino@ui3.info>
older
last modified 2009-06-07