This commit is contained in:
Laurent Destailleur
2017-09-18 16:06:58 +02:00
parent c11ff4a18c
commit 70b11f18b5

View File

@@ -1559,7 +1559,7 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=
}
/**
* Convert an image file into anoher format.
* Convert an image file into another format.
* This need Imagick php extension.
*
* @param string $fileinput Input file name
@@ -1574,7 +1574,12 @@ function dol_convert_file($fileinput,$ext='png',$fileoutput='')
if (class_exists('Imagick'))
{
$image=new Imagick();
try {
$ret = $image->readImage($fileinput);
} catch(Exception $e) {
dol_syslog("Failed to read image using Imagick. Try to install package 'apt-get install ghostscript'.", LOG_WARNING);
return 0;
}
if ($ret)
{
$ret = $image->setImageFormat($ext);