Skip to content

Commit

Permalink
* Handle maddening new ImageMagick behavior that won't operate on
Browse files Browse the repository at this point in the history
  the file named.
  • Loading branch information
perusionmike committed Dec 7, 2003
1 parent 1cd0fa7 commit 26386a4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions code/SystemTag/image.tag
Expand Up @@ -332,6 +332,11 @@ sub {
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);
Expand All @@ -354,6 +359,10 @@ sub {
last MOGIT;
}

if(-f $mgkpath) {
rename $mgkpath, $newpath
or die "Could not overwrite image with new one!";
}
$image =~ s:(/?)([^/]+$):$1$siz/$2:;
$path = $newpath;
}
Expand Down

0 comments on commit 26386a4

Please sign in to comment.