log errors and set $success to false

This commit is contained in:
Uwe Steinmann 2024-03-27 19:49:52 +01:00
parent a05a0b9b49
commit 6b91d3ce40
2 changed files with 18 additions and 0 deletions

View File

@ -67,8 +67,18 @@ class SeedDMS_ConversionServiceImageToImage extends SeedDMS_ConversionServiceBas
} else {
return $imagick->getImageBlob();
}
} else {
if($this->logger) {
$this->logger->log('Conversion from '.$this->from.' to '.$this->to.' with image service failed: could not read input file.', PEAR_LOG_ERR);
}
$this->success = false;
return false;
}
} catch (ImagickException $e) {
if($this->logger) {
$this->logger->log('Conversion from '.$this->from.' to '.$this->to.' with image service failed: '.$e->getMessage(), PEAR_LOG_ERR);
}
$this->success = false;
return false;
}
} elseif(extension_loaded('gd')) {
@ -102,6 +112,10 @@ class SeedDMS_ConversionServiceImageToImage extends SeedDMS_ConversionServiceBas
return $image;
}
} else {
if($this->logger) {
$this->logger->log('Conversion from '.$this->from.' to '.$this->to.' with image service failed: could not read input file.', PEAR_LOG_ERR);
}
$this->success = false;
return false;
}
}

View File

@ -83,6 +83,10 @@ class SeedDMS_ConversionServicePdfToImage extends SeedDMS_ConversionServiceBase
} else {
return $imagick->getImageBlob();
}
} else {
if($this->logger) {
$this->logger->log('Conversion from '.$this->from.' to '.$this->to.' with pdf service failed: could not read input file.', PEAR_LOG_ERR);
}
}
} catch (ImagickException $e) {
if($this->logger) {