summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/VNEdit.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-07-18 00:59:40 +0200
committerYorhel <git@yorhel.nl>2015-07-18 00:59:40 +0200
commitda49b95f180b6fab068bdf88d4d206ca8db2f06b (patch)
treef476540aa013c73dd35921888e0a904b5b230f2f /lib/VNDB/Handler/VNEdit.pm
parent26a3a284515d49b834c4de100f418ad91e2b7839 (diff)
Handler::(VNEdit|Chars): Fix removal of alpha layer in images
Apparently, imagemagick's Flatten() has some odd corner cases where it seems to do more than just remove the alpha layer. The current approach is the one recommended by the official docs: http://www.imagemagick.org/Usage/masking/#remove
Diffstat (limited to 'lib/VNDB/Handler/VNEdit.pm')
-rw-r--r--lib/VNDB/Handler/VNEdit.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/VNDB/Handler/VNEdit.pm b/lib/VNDB/Handler/VNEdit.pm
index 73201073..8a85b989 100644
--- a/lib/VNDB/Handler/VNEdit.pm
+++ b/lib/VNDB/Handler/VNEdit.pm
@@ -252,7 +252,8 @@ 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 = $im->Flatten;
+ $im->Set(background => '#ffffff');
+ $im->Set(alpha => 'Remove');
if($ow != $nw || $oh != $nh) {
$im->GaussianBlur(geometry => '0.5x0.5');
$im->Resize(width => $nw, height => $nh);