Skip to content

Commit

Permalink
Changed defaults back to use TIF. Corrected spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
sbs20 committed Dec 6, 2016
1 parent 193bbc7 commit 2c54652
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions api.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static function HandleScanRequest($request) {
$scanRequest->contrast = (int)$clientRequest->contrast;
}

$outputfile = Config::OutputDirectory."Scan_".date("Y-m-d H.i.s",time()).".".Config::OutputExtention ;
$outputfile = Config::OutputDirectory."Scan_".date("Y-m-d H.i.s",time()).".".Config::OutputExtension ;
$scanRequest->outputFilepath = $outputfile;
$scanRequest->outputFilter = Config::OutputFilter;
$scanner = new Scanimage();
Expand Down Expand Up @@ -114,7 +114,7 @@ public static function HandleFileListRequest() {
$outdir = System::OutputDirectory();

foreach (new DirectoryIterator($outdir) as $fileinfo) {
if(!is_dir($outdir.$fileinfo) && $fileinfo->getExtension() === Config::OutputExtention) {
if(!is_dir($outdir.$fileinfo) && $fileinfo->getExtension() === Config::OutputExtension) {
$files[$fileinfo->getMTime()] = $fileinfo->getFilename();
}
}
Expand Down
20 changes: 17 additions & 3 deletions classes_php/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,27 @@
class Config {
const IsTrace = false;
const TraceLineEnding = "<br>\n";

// You may need to update the paths to scanimage and convert according to
// your installation.
const Scanimage = "/opt/bin/scanimage";
const Convert = "/opt/bin/convert";
const OutputFilter = "/opt/bin/convert 2>/dev/null - -normalize -sharpen 0x1 ";
const PreviewFilter = "/opt/bin/convert 2>/dev/null - -trim -quality 30 ";
const OutputExtention = "jpg";
// const OutputExtention = "tif";

// Use an empty filter by default. The spirit of the default implementation
// is to create non-lossy scans with no post processing. Should you wish to
// override this behaviour then change the filter which will have the scanimage
// output piped to it.
const OutputFilter = "";
//const OutputFilter = "/opt/bin/convert 2>/dev/null - -normalize -sharpen 0x1 ";

// As with the output filter, the default implementation prefers non-lossy
// output. Should you wish you override this then you can change the output
// type below
const OutputExtension = "tif";
// const OutputExtension = "jpg";

// Only useful for development debugging
const BypassSystemExecute = false;
const OutputDirectory = "./output/";
const PreviewDirectory = "./preview/";
Expand Down

0 comments on commit 2c54652

Please sign in to comment.