summaryrefslogtreecommitdiffabout
authorAndy Shevchenko <andy@smile.org.ua>2007-01-13 16:01:46 (GMT)
committer Andy Shevchenko <andy@smile.org.ua>2007-01-13 16:01:46 (GMT)
commitef6e00918b5e4f4b209c179a5409ef1c5400c507 (patch) (side-by-side diff)
tree88996947e1da02c25a3f93afa6031299ef73e47d
parent6826526eaf8f883146c267c4645cd41d3b342a42 (diff)
downloadrenrot-ef6e00918b5e4f4b209c179a5409ef1c5400c507.tar.gz
renrot-ef6e00918b5e4f4b209c179a5409ef1c5400c507.tar.bz2
Split our tag writting to separate function.
git-svn-id: file:///svnroot/renrot/trunk@282 fe2816f4-e837-0410-b10a-f608c9d244a1
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ChangeLog4
-rw-r--r--TODO6
-rwxr-xr-xrenrot50
-rw-r--r--renrot.spec2
4 files changed, 40 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 2c690f2..95f95fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
$Log$
+Revision 1.175 2007/01/13 16:01:46 andy
+Split our tag writting to separate function.
+
Revision 1.174 2006/12/24 11:54:26 zeus
RenRotFileNameOriginal cleanin bug fixed. The tag writing moved from
renameFile() to renRotProcess().
@@ -675,3 +678,4 @@ 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/TODO b/TODO
index 1c031c3..5cafbbb 100644
--- a/TODO
+++ b/TODO
@@ -9,10 +9,10 @@ q optional feature
BUGS
-- fix cleaning RenRotFileNameOriginal while rotating file, previously renroted
+- fix cleaning RenRotFileNameOriginal while rotating file, previously renroted
(reported by Alex Zasypkin)
-- fix cleaning EXIFs when --no-backup is given
++ fix cleaning EXIFs when --no-backup is given
- make possible to use same EXIF tags in different groups
@@ -32,7 +32,7 @@ PLUGINS
- print some text on image (i.e. date and timestamp) [guess perl-GD will be
optional requrement]
-- speceffects (thumbnail layering over the image e.t.c.)
+- special effects (thumbnail layering over the image e.t.c.)
- jpgfromraw
diff --git a/renrot b/renrot
index b663a68..9bada72 100755
--- a/renrot
+++ b/renrot
@@ -666,25 +666,10 @@ sub renRotProcess {
# analyzing whether and how to rename file
$newFileName = renameFile($exifToolObj, $info, $file, $fileCounter, $counterSize, $angleSuffix);
-
+
# to save RenRotFileNameOriginal tag we have to rewrite it each time we anyhow prosess file
- my $fileNameOriginal = $exifToolObj->GetValue("RenRotFileNameOriginal");
- if (not defined $fileNameOriginal) {
- $tags{'RenRotFileNameOriginal'} = {value => $file, group => 'RenRot'};
- dbgmsg (2, "renameFile(): set RenRotFileNameOriginal to $file.\n");
- } else {
+ saveOurHdrs($exifToolObj, $info, $file);
- $tags{'RenRotFileNameOriginal'} = {
- value => $info->{"RenRotFileNameOriginal"},
- group => 'RenRot'
- };
- dbgmsg (2, "renameFile(): RenRotFileNameOriginal: $fileNameOriginal.\n");
- }
- $exifToolObj->SetNewValue(
- "RenRotFileNameOriginal",
- $tags{'RenRotFileNameOriginal'}{value},
- Group => $tags{'RenRotFileNameOriginal'}{group}
- );
# Writing tags.
tagWriter($exifToolObj, $newFileName) if ($noTags == 0);
@@ -699,6 +684,35 @@ sub renRotProcess {
########################################################################################
#
+# saveOurHdrs() saves our defined tags to file
+#
+sub saveOurHdrs {
+ my $exifToolObj = shift;
+ my $infoObj = shift;
+ my $file = shift;
+
+ my $fileNameOriginal = $exifToolObj->GetValue("RenRotFileNameOriginal");
+
+ if (not defined $fileNameOriginal) {
+ $tags{'RenRotFileNameOriginal'} = {value => $file, group => 'RenRot'};
+ dbgmsg (2, "saveOurHdrs(): set RenRotFileNameOriginal to $file.\n");
+ } else {
+ $tags{'RenRotFileNameOriginal'} = {
+ value => $infoObj->{"RenRotFileNameOriginal"},
+ group => 'RenRot'
+ };
+ dbgmsg (2, "saveOurHdrs(): RenRotFileNameOriginal: $fileNameOriginal.\n");
+ }
+
+ $exifToolObj->SetNewValue(
+ "RenRotFileNameOriginal",
+ $tags{'RenRotFileNameOriginal'}{value},
+ Group => $tags{'RenRotFileNameOriginal'}{group}
+ );
+}
+
+########################################################################################
+#
# rotateFile() rotates file and its thumbnail if needed, changes Orientation tag
#
sub rotateFile {
@@ -1127,7 +1141,7 @@ sub rotateImg {
rename ($oldfile, $origfile) || ( fatalmsg ("$oldfile -> $origfile\n"), die );
}
rename ($newfile, $oldfile) || ( fatalmsg ("$newfile -> $oldfile\n"), die );
-
+
# writing the changes to the EXIFs
exifWriter($exifAfterRot, $oldfile);
}
diff --git a/renrot.spec b/renrot.spec
index febadac..d98c44b 100644
--- a/renrot.spec
+++ b/renrot.spec
@@ -39,7 +39,7 @@ make install PREFIX=$RPM_BUILD_ROOT%{_prefix}
# Fix renrot permissions
chmod 755 $RPM_BUILD_ROOT%{_bindir}/renrot
-# install sample confuration files
+# install sample configuration files
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
install -m644 etc/colors.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
install -m644 etc/copyright.tag $RPM_BUILD_ROOT%{_sysconfdir}/%{name}

Return to:

Send suggestions and report system problems to the System administrator.