X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/37bb3836bf4e1890aaa1c5d76161f40587dd68d0..c4af187b7b7518a0810e90f8fd79caba84ac0d34:/Shiar_Sheet/ImagePrep.pm diff --git a/Shiar_Sheet/ImagePrep.pm b/Shiar_Sheet/ImagePrep.pm index 04a4270..328cb4f 100644 --- a/Shiar_Sheet/ImagePrep.pm +++ b/Shiar_Sheet/ImagePrep.pm @@ -4,7 +4,7 @@ use 5.020; use warnings; use experimental 'signatures'; -our $VERSION = '1.02'; +our $VERSION = '1.03'; sub new ($class, $target) { bless \$target, $class; @@ -43,7 +43,7 @@ sub generate ($imgpath, $thumbpath, $opt) { ); } -sub convert ($imgpath, $thumbpath, $cmds, $xyres) { +sub convert ($imgpath, $thumbpath, $cmds, $xyres = 0) { #my ($w, $h) = $imgpath->dimensions; #my $aspect = 3/2; # $xyres my @cmds = @{$cmds}; @@ -72,7 +72,7 @@ sub convert ($imgpath, $thumbpath, $cmds, $xyres) { '-strip', -quality => '60%', -interlace => 'plane', -gravity => defined $cmds ? 'northwest' : 'center', @cmds, - -resize => "$xyres^", -extent => $xyres, + $xyres ? (-resize => "$xyres^", -extent => $xyres) : (), $thumbpath );