projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8fa22ab
)
_convert_pdf_to_png: Mehr Warnungen - quotemeta für Dateinamen mit whitespace
author
Jan Büren
<jan@kivitendo.de>
Tue, 23 Nov 2021 11:14:00 +0000
(12:14 +0100)
committer
Jan Büren
<jan@kivitendo.de>
Tue, 23 Nov 2021 11:22:01 +0000
(12:22 +0100)
SL/Controller/File.pm
patch
|
blob
|
history
diff --git
a/SL/Controller/File.pm
b/SL/Controller/File.pm
index
9005d79
..
7cd9406
100644
(file)
--- a/
SL/Controller/File.pm
+++ b/
SL/Controller/File.pm
@@
-679,7
+679,12
@@
sub _convert_pdf_to_png {
my $size = $params{size} // 64;
my $sfile = SL::SessionFile::Random->new();
my $size = $params{size} // 64;
my $sfile = SL::SessionFile::Random->new();
- my $command = 'pdftoppm -singlefile -scale-to ' . $size . ' -png' . ' ' . $filename . ' ' . $sfile->file_name;
+ unless (-f $filename) {
+ $::lxdebug->message(LXDebug::WARN(), "_convert_pdf_to_png failed, no file found: $filename");
+ return;
+ }
+ # quotemeta for storno case "storno\ zu\ 1020" *nix only
+ my $command = 'pdftoppm -singlefile -scale-to ' . $size . ' -png' . ' ' . quotemeta($filename) . ' ' . $sfile->file_name;
if (system($command) == -1) {
$::lxdebug->message(LXDebug::WARN(), "SL::File::_convert_pdf_to_png: system call failed: " . $ERRNO);
if (system($command) == -1) {
$::lxdebug->message(LXDebug::WARN(), "SL::File::_convert_pdf_to_png: system call failed: " . $ERRNO);
@@
-687,6
+692,7
@@
sub _convert_pdf_to_png {
}
if ($CHILD_ERROR) {
$::lxdebug->message(LXDebug::WARN(), "SL::File::_convert_pdf_to_png: pdftoppm failed with error code: " . ($CHILD_ERROR >> 8));
}
if ($CHILD_ERROR) {
$::lxdebug->message(LXDebug::WARN(), "SL::File::_convert_pdf_to_png: pdftoppm failed with error code: " . ($CHILD_ERROR >> 8));
+ $::lxdebug->message(LXDebug::WARN(), "SL::File::_convert_pdf_to_png: File: $filename");
return;
}
return;
}