Fix file path of cropped image

This commit is contained in:
John Mertz 2022-09-22 14:32:39 -04:00
parent bc61b23883
commit fa007b60ef
Signed by: jpm
GPG Key ID: E9C5EA2D867501AB
1 changed files with 3 additions and 3 deletions

View File

@ -226,7 +226,7 @@ sub crop
my $oh = shift;
my $cropped = $image;
$cropped =~ s#^.*/([^/]*)\.([^\.]+)$#$1-cropped.$2#;
$cropped =~ s#^.*/([^/]*)\.([^\.]+)$#$self->{'path'}$1-cropped.$2#;
#$image = "/tmp/Pharma-out.png.jpg";
use Image::Magick;
@ -355,9 +355,9 @@ sub run
}
$self->set_background($target,$cropped);
if ($self->{crop}) {
$self->do_log('LOG_DEBUG', "Deleting $cropped");
# Give swaybg a second, otherwise the file will be missing before it ends
sleep(2);
sleep(1);
$self->do_log('LOG_DEBUG', "Deleting $cropped");
unlink($cropped) || $self->do_log("LOG_WARNING", "Failed to delete $cropped after setting: $!");
}
} else {