Closed DanielO closed 5 years ago
After smashing my head against the POLA violations of PHP I find this code works..
diff --git a/classes_php/Scanimage.php b/classes_php/Scanimage.php
index dc8daf0..bf47e12 100644
--- a/classes_php/Scanimage.php
+++ b/classes_php/Scanimage.php
@@ -35,7 +35,7 @@ class Scanimage implements IScanner {
}
// No output filter or default output format which is handled by scanimage directly
- if (empty(Config::OutputFilter) || $scanRequest->format == Config::OutputExtension) {
+ if (defined("Config::OutputFilter") || $scanRequest->format == Config::OutputExtension) {
$cmd = $cmd . ' > "' . $scanRequest->outputFilepath . '"';
} else {
$cmd = $cmd . ' | ' . $cmd2 . ' "' . $scanRequest->outputFilepath . '"';
Also the default config example of.. const OutputFilter = self::Convert . " - ";
does not work, you can't reference self::Convert this way (nor does Config::Convert work)
I removed this since I wanted an empty output filter, but otherwise I would suggest just using 'cat'.
@DanielO can you create pull request?
Done
Merged. I'm so sorry this has taken forever to do.
Hi, I was trying this out and I see..
[Thu Apr 19 11:09:51.201699 2018] [fcgid:warn] [pid 51408] [client 1.2.3.4:58676] mod_fcgid: stderr: PHP Parse error: syntax error, unexpected ')', expecting '(' in /home/xxx/scanserv/classes_php/Scanimage.php on line 38, referer: https://1.2.3.4/scanserve/
I had a look but I'm not very knowledgable about PHP.