summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-12-24 13:31:50 +0100
committerYorhel <git@yorhel.nl>2020-12-24 13:31:52 +0100
commit3b35e2b16d0150a54508c86a9ed684394deff2fe (patch)
tree70f45eb5c6602de97272d54e8e0486739c1ad3d9 /lib
parent232b2312a61af6e4299f9318050617530c9d5728 (diff)
Images::Upload: Fixup saving of sharpened images as png
Turns out the -format argument doesn't do anything and the output format is instead determined by the filename.
Diffstat (limited to 'lib')
-rw-r--r--lib/VNWeb/Images/Upload.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/VNWeb/Images/Upload.pm b/lib/VNWeb/Images/Upload.pm
index d4328bba..214e87ad 100644
--- a/lib/VNWeb/Images/Upload.pm
+++ b/lib/VNWeb/Images/Upload.pm
@@ -25,7 +25,7 @@ TUWF::post qr{/elm/ImageUpload.json}, sub {
my $fn0 = tuwf->imgpath($id, 0);
my $fn1 = tuwf->imgpath($id, 1);
- my $fntmp = "$fn0.tmp";
+ my $fntmp = "$fn0-tmp.jpg";
sub resize { (-resize => "$_[0][0]x$_[0][1]>", -print => 'r:%wx%h') }
my @unsharp = (-unsharp => '0x0.75+0.75+0.008');
@@ -33,8 +33,7 @@ TUWF::post qr{/elm/ImageUpload.json}, sub {
config->{convert_path}, '-',
'-strip', -define => 'filter:Lagrange',
-background => '#fff', -alpha => 'Remove',
- -format => 'jpg', -quality => 90,
- -print => 'o:%wx%h',
+ -quality => 90, -print => 'o:%wx%h',
$type eq 'ch' ? (resize(tuwf->{ch_size}), -write => $fn0, @unsharp, $fntmp) :
$type eq 'cv' ? (resize(tuwf->{cv_size}), -write => $fn0, @unsharp, $fntmp) :
$type eq 'sf' ? (-write => $fn0, resize(tuwf->{scr_size}), @unsharp, $fn1) : die