mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
Change graphic library priority, ext_imagemick is now preffered
This commit is contained in:
committed by
Pierrick Le Gall
parent
61961bd172
commit
66df209632
@@ -3726,6 +3726,14 @@ function get_graphics_library()
|
||||
|
||||
switch (pwg_image::get_library())
|
||||
{
|
||||
case 'ext_imagick':
|
||||
exec($conf['ext_imagick_dir'].'convert -version', $returnarray);
|
||||
if (preg_match('/Version: ImageMagick (\d+\.\d+\.\d+-?\d*)/', $returnarray[0], $match))
|
||||
{
|
||||
$library.= '/'.$match[1];
|
||||
}
|
||||
break;
|
||||
|
||||
case 'imagick':
|
||||
$img = new Imagick();
|
||||
$version = $img->getVersion();
|
||||
@@ -3735,14 +3743,6 @@ function get_graphics_library()
|
||||
}
|
||||
break;
|
||||
|
||||
case 'ext_imagick':
|
||||
exec($conf['ext_imagick_dir'].'convert -version', $returnarray);
|
||||
if (preg_match('/Version: ImageMagick (\d+\.\d+\.\d+-?\d*)/', $returnarray[0], $match))
|
||||
{
|
||||
$library.= '/'.$match[1];
|
||||
}
|
||||
break;
|
||||
|
||||
case 'gd':
|
||||
$gd_info = gd_info();
|
||||
$library.= '/'.@$gd_info['GD Version'];
|
||||
|
||||
@@ -406,16 +406,16 @@ class pwg_image
|
||||
switch (strtolower($library))
|
||||
{
|
||||
case 'auto':
|
||||
case 'imagick':
|
||||
if ($extension != 'gif' and self::is_imagick())
|
||||
{
|
||||
return 'imagick';
|
||||
}
|
||||
case 'ext_imagick':
|
||||
if ($extension != 'gif' and self::is_ext_imagick())
|
||||
{
|
||||
return 'ext_imagick';
|
||||
}
|
||||
case 'imagick':
|
||||
if ($extension != 'gif' and self::is_imagick())
|
||||
{
|
||||
return 'imagick';
|
||||
}
|
||||
case 'gd':
|
||||
if (self::is_gd())
|
||||
{
|
||||
|
||||
@@ -318,17 +318,6 @@ $template->assign(
|
||||
// graphics library
|
||||
switch (pwg_image::get_library())
|
||||
{
|
||||
case 'imagick':
|
||||
$library = 'ImageMagick';
|
||||
$img = new Imagick();
|
||||
$version = $img->getVersion();
|
||||
if (preg_match('/ImageMagick \d+\.\d+\.\d+-?\d*/', $version['versionString'], $match))
|
||||
{
|
||||
$library = $match[0];
|
||||
}
|
||||
$template->assign('GRAPHICS_LIBRARY', $library);
|
||||
break;
|
||||
|
||||
case 'ext_imagick':
|
||||
$library = 'External ImageMagick';
|
||||
exec($conf['ext_imagick_dir'].'convert -version', $returnarray);
|
||||
@@ -339,6 +328,17 @@ switch (pwg_image::get_library())
|
||||
$template->assign('GRAPHICS_LIBRARY', $library);
|
||||
break;
|
||||
|
||||
case 'imagick':
|
||||
$library = 'ImageMagick';
|
||||
$img = new Imagick();
|
||||
$version = $img->getVersion();
|
||||
if (preg_match('/ImageMagick \d+\.\d+\.\d+-?\d*/', $version['versionString'], $match))
|
||||
{
|
||||
$library = $match[0];
|
||||
}
|
||||
$template->assign('GRAPHICS_LIBRARY', $library);
|
||||
break;
|
||||
|
||||
case 'gd':
|
||||
$gd_info = gd_info();
|
||||
$template->assign('GRAPHICS_LIBRARY', 'GD '.@$gd_info['GD Version']);
|
||||
|
||||
Reference in New Issue
Block a user