[ANNOUNCE] DigicaMerge v1.50
Jerome Alet
alet at unice.fr
Fri Jan 10 07:01:39 EST 2003
Hi,
I'm pleased to announce the immediate availability for download of
DigicaMerge v1.50.
DigicaMerge is a Python command line tool created to ease the management
and merging of directories containing digital pictures (taken with
digicams) without worrying about name clashes.
DigicaMerge is available for download under the terms of the GNU General
Public License from :
http://www.librelogiciel.com/software/
DigicaMerge first purpose is to merge many source directories into one
destination directory, but DigicaMerge can also make interesting things
automatically, like modify access and modification time to set
both to the date and time each picture was taken, for example.
DigicaMerge allows complete control over picture selecting and naming, by
giving transparent access to the Exif data present in the files as well as
some predefined variables (counters, date, time, etc...), and allows external
post-processing commands to be launched (e.g. jhead) enhancing their usage
possibilities by defining many environment variables prefixed with the
string 'DGCM' to export DigicaMerge internal state.
See below for the command line options and examples :
digicamerge [options] srcdir1 [srcdir2 ... srcdirN] destination
options :
-v | --version Prints DigicaMerge's version number then exits.
-h | --help Prints this message then exits.
-q | --quiet Doesn't print progress indicator.
-m | --mode M Does a chmod to mode M after each file move.
M is in octal but may not have a leading 0,
for example both 644 and 0644 work.
-p | --pattern P Uses pattern P to select the files to move to
the destination directory.
P default value is "*.jpg" which is convenient
for most cases.
-s | --scheme S Defines the naming scheme for the files created in
the destination directory. The default naming
scheme is "dscf%(count1)04i.jpg" which matches my
digital camera default naming scheme.
You can currently use the following named formats,
which are all strings except count0 and count1
which are integers :
count0 : file number beginning at 0
count1 : file number beginning at 1
date : date at which the picture was taken in
the YYYYMMDD format.
isodate : same as above but in ISO8601 format,
i.e. YYYY-MM-DD
year : year in YYYY format
month : month in MM format
day : day in DD format
hour : hour in hh format
minute : minute in mm format
second : second in ss format
time : time in hhmmss format
You can also use all recognized Exif Tags, like
ExposureProgram or ExifImageHeight for example.
A naming scheme MUST contain either %(count0) or
%(count1) to avoid duplicate file names.
The default naming scheme produces file names like :
dscf0001.jpg
dscf0002.jpg
...
Look at the Python language string formatting
capabilities to learn how to create your own
naming scheme.
-c | --command C Launches command C on each picture *after* each picture
move, but *before* the access and modification date and
time or access mode are modified. The C command can use
environment variables to access to the predefined values
discussed above, as well as to each Exif tag. All are
available under the names listed above prefixed with DGCM,
like DGCMcount1 or DGCMExposureProgram.
Several additional variables are also defined :
DGCMsrcname : Complete source filename
DGCMdstname : Complete destination filename
DGCMsrcdir : Source directory
DGCMdstdir : Destination directory
DGCMsrcbase : Source basename
DGCMdstbase : Destination basename
DGCMsrcprefix : Source basename's prefix
DGCMdstprefix : Destination basename's prefix
DGCMsrcext : Source extension
DGCMdstext : Destination extension
-t | --touch Modifies the file access and modification times according
to the date the picture was taken, as stated in the
DateTime Exif tag.
examples :
$ digicamerge --scheme "%(date)s-%(count0)i.jpeg" christmas newyear 2002end
This will create a new directory named 2002end, and move all *.jpg pictures
from the christmas and newyear directories into 2002end, renaming each file
with the date at which the picture was taken followed by a number beginning
at 0, e.g. : 20021225-45.jpeg
$ digicamerge pics renumbered
This will put all the pictures present in the pics directory into
the renumbered directory. Each picture will be renumbered so that no
numbering hole will exist anymore (numbering holes might have been
created if you deleted some pictures from the pics directory)
$ digicamerge -c "jhead -st ~/thumbnails/\$DGCMdstname \$DGCMdstname" xmas xmas2
This will do like the previous example, but thumbnails will be extracted
from each picture using the jhead command and will be put into the
~/thumbnails/xmas2 directory under the same (possibly new) names.
NB : Don't forget to escape the variable names with an antislash
if you need to, otherwise they may come undefined !
$ digicamerge --touch --scheme "%(Model)s-%(ExifImageWidth)sx%(ExifImageHeight)s-%(count1)04i.jpg" birthday mybirthday
This will put all the pictures present in the birthday directory into
the mybirthday directory. Each file will be renamed with a name which
looks like (for my digital camera) : FinePix S304-2048x1536-0001.jpg
and the access and modification time of the picture files will be
set to the date and time at which each picture was taken.
Hoping that someone will find this software useful, please send any
comment or bug report to : alet at librelogiciel.com
Thank you for reading
Jerome Alet
More information about the Python-list
mailing list