[interchange-cvs] interchange - heins modified code/SystemTag/image.tag

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Sun Dec 7 12:43:28 EST 2003


User:      heins
Date:      2003-12-07 17:43:28 GMT
Modified:  code/SystemTag image.tag
Log:
* Handle maddening new ImageMagick behavior that won't operate on
  the file named.

Revision  Changes    Path
1.6       +9 -0      interchange/code/SystemTag/image.tag


rev 1.6, prev_rev 1.5
Index: image.tag
===================================================================
RCS file: /var/cvs/interchange/code/SystemTag/image.tag,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- image.tag	10 Sep 2003 13:10:00 -0000	1.5
+++ image.tag	7 Dec 2003 17:43:28 -0000	1.6
@@ -332,6 +332,11 @@
 					File::Path::mkpath($dir);
 				}
 
+				my $mgkpath = $newpath;
+				my $ext;
+				$mgkpath =~ s/\.(\w+)$/.mgk/
+					and $ext = $1;
+
 				File::Copy::copy($path, $newpath)
 					or do {
 						logError("%s: Unable to create image '%s'", 'image tag', $newpath);
@@ -354,6 +359,10 @@
 					last MOGIT;
 				}
 
+				if(-f $mgkpath) {
+					rename $mgkpath, $newpath
+						or die "Could not overwrite image with new one!";
+				}
 				$image =~ s:(/?)([^/]+$):$1$siz/$2:;
 				$path = $newpath;
 			}








More information about the interchange-cvs mailing list