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';
|
$this->lastpreviewfile = $target.'.pdf';
|
||||||
if($target != '' && (!file_exists($target.'.pdf') || filectime($target.'.pdf') < filectime($infile))) {
|
if($target != '' && (!file_exists($target.'.pdf') || filectime($target.'.pdf') < filectime($infile))) {
|
||||||
if($this->conversionmgr) {
|
if($this->conversionmgr) {
|
||||||
// if($this->conversionmgr->hasService($mimetype, 'application/pdf')) {
|
if(!$this->conversionmgr->convert($infile, $mimetype, 'application/pdf', $target.'.pdf')) {
|
||||||
return $this->conversionmgr->convert($infile, $mimetype, 'application/pdf', $target.'.pdf');
|
$this->lastpreviewfile = '';
|
||||||
// }
|
return false;
|
||||||
|
}
|
||||||
|
$new = true;
|
||||||
} else {
|
} else {
|
||||||
$cmd = '';
|
$cmd = '';
|
||||||
$mimeparts = explode('/', $mimetype, 2);
|
$mimeparts = explode('/', $mimetype, 2);
|
||||||
|
|
|
@ -122,12 +122,10 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base {
|
||||||
$this->lastpreviewfile = $target.'.png';
|
$this->lastpreviewfile = $target.'.png';
|
||||||
if($target != '' && (!file_exists($target.'.png') || filectime($target.'.png') < filectime($infile))) {
|
if($target != '' && (!file_exists($target.'.png') || filectime($target.'.png') < filectime($infile))) {
|
||||||
if($this->conversionmgr) {
|
if($this->conversionmgr) {
|
||||||
// if($this->conversionmgr->hasService($mimetype, 'image/png')) {
|
if(!$this->conversionmgr->convert($infile, $mimetype, 'image/png', $target.'.png', array('width'=>$width))) {
|
||||||
if(!$this->conversionmgr->convert($infile, $mimetype, 'image/png', $target.'.png', array('width'=>$width))) {
|
$this->lastpreviewfile = '';
|
||||||
$this->lastpreviewfile = '';
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
// }
|
|
||||||
$new = true;
|
$new = true;
|
||||||
} else {
|
} else {
|
||||||
$cmd = '';
|
$cmd = '';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user