git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
67e1fe9
)
word edit: capture image convert error messages
author
Mischa POSLAWSKY
<perl@shiar.org>
Wed, 27 May 2020 17:48:12 +0000
(19:48 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 6 Jun 2020 01:49:20 +0000
(
03:49
+0200)
writer.plp
patch
|
blob
|
history
diff --git
a/writer.plp
b/writer.plp
index 5b81a20e5f6d6df90c2e2ddb2e1a071c480e9465..92459150c238528a31156858f5805cba6902eeb3 100644
(file)
--- a/
writer.plp
+++ b/
writer.plp
@@
-210,11
+210,16
@@
elsif ($ENV{REQUEST_METHOD} eq 'POST') {{
'-strip', -quality => '60%', -interlace => 'plane',
$imgpath => $thumbpath
);
'-strip', -quality => '60%', -interlace => 'plane',
$imgpath => $thumbpath
);
- my $status = system @cmds;
- $status == 0 or Alert([
+ eval {
+ require IPC::Run;
+ my $output;
+ IPC::Run::run(\@cmds, '<' => \undef, '>&' => \$output)
+ or die $output ||
+ ($? & 127 ? "signal $?" : "error code ".($? >> 8))."\n";
+ } or Alert([
"Thumbnail image not generated",
"Thumbnail image not generated",
- "Failed to convert source image
, error code ".($status >> 8)
,
- ], "@cmds");
+ "Failed to convert source image
."
,
+ ], "@cmds
\n$@
");
}
else {
unlink $thumbpath;
}
else {
unlink $thumbpath;