mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
FIX #7367
This commit is contained in:
@@ -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.
|
* This need Imagick php extension.
|
||||||
*
|
*
|
||||||
* @param string $fileinput Input file name
|
* @param string $fileinput Input file name
|
||||||
@@ -1567,14 +1567,19 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=
|
|||||||
* @param string $fileoutput Output filename
|
* @param string $fileoutput Output filename
|
||||||
* @return int <0 if KO, 0=Nothing done, >0 if OK
|
* @return int <0 if KO, 0=Nothing done, >0 if OK
|
||||||
*/
|
*/
|
||||||
function dol_convert_file($fileinput,$ext='png',$fileoutput='')
|
function dol_convert_file($fileinput, $ext='png', $fileoutput='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
if (class_exists('Imagick'))
|
if (class_exists('Imagick'))
|
||||||
{
|
{
|
||||||
$image=new Imagick();
|
$image=new Imagick();
|
||||||
$ret = $image->readImage($fileinput);
|
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)
|
if ($ret)
|
||||||
{
|
{
|
||||||
$ret = $image->setImageFormat($ext);
|
$ret = $image->setImageFormat($ext);
|
||||||
|
|||||||
Reference in New Issue
Block a user