aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeus Panchenko <zeus@camb.us>2006-06-26 09:09:20 +0000
committerZeus Panchenko <zeus@camb.us>2006-06-26 09:09:20 +0000
commit0dfe00d8479766601ff3d6a367e72183ea3bc43c (patch)
treed0f516bc1fff91bf0458d7efa27ac44a498d3f75
parent9ef3b885a057c0e117fab332177595a8399c79cd (diff)
downloadrenrot-0dfe00d8479766601ff3d6a367e72183ea3bc43c.tar.gz
renrot-0dfe00d8479766601ff3d6a367e72183ea3bc43c.tar.bz2
%n and %e template patters've being implemented.
git-svn-id: file:///svnroot/renrot/trunk@214 fe2816f4-e837-0410-b10a-f608c9d244a1
-rw-r--r--ChangeLog4
-rwxr-xr-xrenrot25
2 files changed, 24 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 1a72115..12249bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
$Log$
+Revision 1.138 2006/06/26 09:09:20 zeus
+%n and %e template patters've being implemented.
+
Revision 1.137 2006/06/21 19:36:51 zeus
TODO edited (%n,%e & virtual renaming)
@@ -551,4 +554,3 @@ Id keyword is added to renrot file.
Revision 1.1 2005/10/17 13:39:38 zeus
ChangeLog file is added. Its the very begining.
-
diff --git a/renrot b/renrot
index 6b53c48..4478030 100755
--- a/renrot
+++ b/renrot
@@ -737,7 +737,8 @@ sub renameFile {
$newFileName = template2name($exifToolObj,
$infoObj,
$configOptions{'name template'},
- $fileCounter);
+ $fileCounter,
+ $file);
if ($filenameshash{$newFileName . $ext}) {
$newFileName .= "." . sprintf($counterSize, $fileCounter) . $ext;
} else {
@@ -863,7 +864,8 @@ sub aggregationProcess {
$NewDir = template2name($exifTool,
$info,
$configOptions{'aggregation template'},
- $fileCounter);
+ $fileCounter,
+ $file);
aggregateFile($file, $NewDir) if ($dryRun == 0);
procmsg ("Aggregate: $file -> $NewDir\n", "\n");
@@ -1128,7 +1130,7 @@ sub rotateThumbnail {
sub usage {
infomsg (
"Usage: renrot <--extension EXTENSION> [--quiet] [--no-rotate] [--no-rename]
- [--name-template TPL] [--comment-file FILE] [--work-directory DIR]
+ [--name-template TPL] [--comment-file FILE] [--work-directory DIR]
[[--] FILE1 FILE2 ...]
Options:
@@ -1176,7 +1178,17 @@ sub template2name {
my $infoObj = shift;
my $template = shift; # the template to be used
my $fileNo = shift; # counter for %c
- my $ext = ''; # file extension for %e
+ my $fileName = shift; # file name for %n and %e
+ my ($base, $ext); # file name %n and extension %e
+
+ if ($fileName =~ m/^(.*)\.([^\.]+)$/) {
+ $base = $1;
+ $ext = $2;
+ }
+ else {
+ $base = $fileName;
+ $ext = '';
+ }
if (not defined $template) {
fatalmsg ("Template isn't given!\n"), die;
@@ -1228,6 +1240,7 @@ sub template2name {
'i' => $FileNumber,
'M' => $tm[5],
'm' => $tm[2],
+ 'n' => $base,
'S' => $tm[6],
'W' => $WhiteBalance,
'Y' => $tm[0],
@@ -1337,6 +1350,8 @@ B<%d> day of the month (01-31)
B<%E> ExposureTime tag value if defined
+B<%e> old file extention
+
B<%F> FNumber tag value if defined
B<%H> hour (00-23)
@@ -1350,6 +1365,8 @@ B<%M> minute (00-59)
B<%m> month (01-12)
+B<%n> old file name
+
B<%S> second (00-59)
B<%W> WhiteBalance tag value if defined

Return to:

Send suggestions and report system problems to the System administrator.