





|
command line usage :
DigicaMerge v2.00 (C) 2002-2006 C@LL - Conseil Internet & Logiciels Libres
A command line tool to merge directories of pictures taken
with digital cameras.
If you've got a digital camera, your hard disk probably contains many
directories full of pictures all named with the same names. This utility
allows you to merge such directories' contents into a new directory,
and renames all the pictures on the fly, ensuring no filename clash
will occur.
command line usage :
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.
-n | --nodupes Remove duplicates.
-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
srcname : Complete source filename
srcdir : Source directory
srcbase : Source basename
srcprefix : Source basename's prefix
srcext : Source extension
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.
-C | --copy Copy files instead of moving/renaming them.
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.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
Please e-mail bugs to: Jerome Alet -
|