diff options
author | Yorhel <git@yorhel.nl> | 2020-07-16 17:36:41 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2020-07-16 17:36:43 +0200 |
commit | c6aab8ce3d9141a0977a3c42f19a3d901bcd60c3 (patch) | |
tree | f91f8f5be5d67cefcb47889ba5ba0e13d934dfcb /lib | |
parent | f9daf6bd9bc4bc72a85222dd5e49d0b8a5308e4d (diff) |
Image::Upload: Return error if ImageMagick fails to get image dimensions
The initial regex filetype check doesn't mean that it's a valid image.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNWeb/Images/Upload.pm | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/VNWeb/Images/Upload.pm b/lib/VNWeb/Images/Upload.pm index 4fbc6d64..dd5bbb4d 100644 --- a/lib/VNWeb/Images/Upload.pm +++ b/lib/VNWeb/Images/Upload.pm @@ -41,6 +41,7 @@ TUWF::post qr{/elm/ImageUpload.json}, sub { $im->Set(quality => 90); my($ow, $oh) = ($im->Get('width'), $im->Get('height')); + return elm_ImgFormat if !$ow || !$oh; my($nw, $nh) = $type eq 'ch' ? imgsize $ow, $oh, tuwf->{ch_size}->@* : $type eq 'cv' ? imgsize $ow, $oh, tuwf->{cv_size}->@* : ($ow, $oh); |