diff options
author | Yorhel <git@yorhel.nl> | 2015-07-12 11:34:27 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2015-07-12 11:34:27 +0200 |
commit | 642e6b2bcf2389210e572aeaf7e7bd020f9cb999 (patch) | |
tree | dd84e59350b9cfab63e277e19136b29abeedd30a /lib/VNDB/Handler/VNEdit.pm | |
parent | a928bce7ff08222800022d0c6283bed79ca72491 (diff) |
Handler::VNEdit: Use better resizing algorithm
Same as 2f61c4f6772f852f9e0b9ede6228de4e4dbf71a0
Diffstat (limited to 'lib/VNDB/Handler/VNEdit.pm')
-rw-r--r-- | lib/VNDB/Handler/VNEdit.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/VNDB/Handler/VNEdit.pm b/lib/VNDB/Handler/VNEdit.pm index fce40956..73201073 100644 --- a/lib/VNDB/Handler/VNEdit.pm +++ b/lib/VNDB/Handler/VNEdit.pm @@ -252,7 +252,12 @@ sub _uploadimage { $im->Set(magick => 'JPEG'); my($ow, $oh) = ($im->Get('width'), $im->Get('height')); my($nw, $nh) = imgsize($ow, $oh, @{$self->{cv_size}}); - $im->Thumbnail(width => $nw, height => $nh); + $im = $im->Flatten; + if($ow != $nw || $oh != $nh) { + $im->GaussianBlur(geometry => '0.5x0.5'); + $im->Resize(width => $nw, height => $nh); + $im->UnsharpMask(radius => 0, sigma => 0.75, amount => 0.75, threshold => 0.008); + } $im->Set(quality => 90); # Get ID and save |