execWithTimeout() fails if cmd returns something in stderr

This commit is contained in:
Uwe Steinmann 2023-05-15 08:11:14 +02:00
parent 5a96788ccc
commit 0affcd93e7

View File

@ -159,6 +159,7 @@ class SeedDMS_ConversionServiceExec extends SeedDMS_ConversionServiceBase {
/* %s was just added because the commands to convert to text/plain used
* it instead of %f for the input file
* %f = input file
* %if = format (jpg, png, pdf, gif)
* %o = output file
* %m = mime type
* %w = width
@ -175,6 +176,12 @@ class SeedDMS_ConversionServiceExec extends SeedDMS_ConversionServiceBase {
}
return false;
}
if(!empty($ret['stderr'])) {
if($this->logger) {
$this->logger->log('Conversion from '.$this->from.' to '.$this->to.' with cmd "'.$this->cmd.'" failed: '.$ret['stderr'], PEAR_LOG_ERR);
}
return false;
}
$end = microtime(true);
if($this->logger) {
$this->logger->log('Conversion from '.$this->from.' to '.$this->to.' with cmd "'.$this->cmd.'" took '.($end-$start).' sec.', PEAR_LOG_DEBUG);