mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +00:00
better error checking if conversion fails
This commit is contained in:
parent
91a081325d
commit
ad0f3b2cfe
|
@ -113,9 +113,11 @@ class SeedDMS_Preview_PdfPreviewer extends SeedDMS_Preview_Base {
|
|||
$this->lastpreviewfile = $target.'.pdf';
|
||||
if($target != '' && (!file_exists($target.'.pdf') || filectime($target.'.pdf') < filectime($infile))) {
|
||||
if($this->conversionmgr) {
|
||||
// if($this->conversionmgr->hasService($mimetype, 'application/pdf')) {
|
||||
return $this->conversionmgr->convert($infile, $mimetype, 'application/pdf', $target.'.pdf');
|
||||
// }
|
||||
if(!$this->conversionmgr->convert($infile, $mimetype, 'application/pdf', $target.'.pdf')) {
|
||||
$this->lastpreviewfile = '';
|
||||
return false;
|
||||
}
|
||||
$new = true;
|
||||
} else {
|
||||
$cmd = '';
|
||||
$mimeparts = explode('/', $mimetype, 2);
|
||||
|
|
|
@ -122,12 +122,10 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base {
|
|||
$this->lastpreviewfile = $target.'.png';
|
||||
if($target != '' && (!file_exists($target.'.png') || filectime($target.'.png') < filectime($infile))) {
|
||||
if($this->conversionmgr) {
|
||||
// if($this->conversionmgr->hasService($mimetype, 'image/png')) {
|
||||
if(!$this->conversionmgr->convert($infile, $mimetype, 'image/png', $target.'.png', array('width'=>$width))) {
|
||||
$this->lastpreviewfile = '';
|
||||
return false;
|
||||
}
|
||||
// }
|
||||
if(!$this->conversionmgr->convert($infile, $mimetype, 'image/png', $target.'.png', array('width'=>$width))) {
|
||||
$this->lastpreviewfile = '';
|
||||
return false;
|
||||
}
|
||||
$new = true;
|
||||
} else {
|
||||
$cmd = '';
|
||||
|
|
Loading…
Reference in New Issue
Block a user