Skip to content

Commit

Permalink
Suppress warnings from 'convert'. Was confusing streaming output (dea…
Browse files Browse the repository at this point in the history
…dlock since we assume output on stderr means there will be no output on stdout).
  • Loading branch information
mangtronix committed Oct 12, 2011
1 parent 5b1ca1a commit 03eab96
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions BookReaderIA/datanode/BookReaderImages.inc.php
Expand Up @@ -447,7 +447,7 @@ function serveRequest($requestEnv) {


$errorMessage = '';

if (! $this->passthruIfSuccessful($headers, $cmd, $errorMessage)) { // $$$ move to BookReaderRequest
// $$$ automated reporting
trigger_error('BookReader Processing Error: ' . $cmd . ' -- ' . $errorMessage, E_USER_WARNING);
Expand Down Expand Up @@ -689,7 +689,7 @@ function getDecompressCmd($srcInfo, $powReduce, $rotate, $scale, $region, $stdou
$rotateString = ' -rotate ' . $rotate; // was previously checked to be a known value
}

$decompressCmd = ' | convert -' . $regionString . $scaleString . $rotateString . ' pnm:-';
$decompressCmd = ' | convert -quiet -' . $regionString . $scaleString . $rotateString . ' pnm:-';
break;

default:
Expand All @@ -710,7 +710,7 @@ function getDecompressCmd($srcInfo, $powReduce, $rotate, $scale, $region, $stdou
// &$errorMessage - error string if there was an error
//
// $$$ Tested with our command-line image processing. May be deadlocks for
// other cases.
// other cases, e.g. if there are warnings on stderr
function passthruIfSuccessful($headers, $cmd, &$errorMessage)
{
$retVal = false;
Expand Down Expand Up @@ -1056,6 +1056,19 @@ function clamp($minValue, $maxValue, $observedValue) {
return $observedValue;
}

// Get the directory for temporary files. Use the fast in-RAM tmp if available.
/*
function getTempDir() {
var $fast = '/var/tmp/fast';
if (is_dir($fast)) {
// We assume it's writeable
return $fast;
}
return '/tmp';
}
*/

// Clean up temporary files and resources
function cleanup() {
foreach($this->tempFiles as $tempFile) {
Expand Down

0 comments on commit 03eab96

Please sign in to comment.