I noticed that the maintenance page in Piwigo 16 doesn't show ext_imagick, so I found out there is probably a bug in "get_ext_imagick_command()" function (image.class.php).
From the use in code I think this function is supposed to return only command to run (magick/convert), but it in fact returns ext_imagick_dir (path) as well.
static function get_ext_imagick_command()
{
global $page, $conf;
if (!isset($page['ext_imagick_command']))
{
$retval=null;
$cmd_out=null;
// check if magick is in path
exec('command -v '.$conf['ext_imagick_dir'].'magick', $cmd_out , $retval );
if (0 == $retval)
{
$page['ext_imagick_command'] = 'magick';
}
else
{
$page['ext_imagick_command'] = 'convert';
}
}
return $page['ext_imagick_command'];
}
After this change the external ImageMagick is shown.
Thank you.
Hi,
I noticed that the maintenance page in Piwigo 16 doesn't show ext_imagick, so I found out there is probably a bug in "get_ext_imagick_command()" function (image.class.php).
From the use in code I think this function is supposed to return only command to run (magick/convert), but it in fact returns ext_imagick_dir (path) as well.
[https://github.com/Piwigo/Piwigo/commit/3293b329e916b743c56f786227a1be6c47f0f4c9](https://github.com/Piwigo/Piwigo/commit/3293b329e916b743c56f786227a1be6c47f0f4c9)
So when other function use it (like is_ext_imagick()), the result is wrong (due to duplicate path):
`@exec($conf['ext_imagick_dir'].pwg_image::get_ext_imagick_command().' -version', $returnarray);`
The function should be probably like this:
```
static function get_ext_imagick_command()
{
global $page, $conf;
if (!isset($page['ext_imagick_command']))
{
$retval=null;
$cmd_out=null;
// check if magick is in path
exec('command -v '.$conf['ext_imagick_dir'].'magick', $cmd_out , $retval );
if (0 == $retval)
{
$page['ext_imagick_command'] = 'magick';
}
else
{
$page['ext_imagick_command'] = 'convert';
}
}
return $page['ext_imagick_command'];
}
```
After this change the external ImageMagick is shown.
Thank you.
<!-- github-sync-id:3668675503 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Hi,
I noticed that the maintenance page in Piwigo 16 doesn't show ext_imagick, so I found out there is probably a bug in "get_ext_imagick_command()" function (image.class.php).
From the use in code I think this function is supposed to return only command to run (magick/convert), but it in fact returns ext_imagick_dir (path) as well.
https://github.com/Piwigo/Piwigo/commit/3293b329e916b743c56f786227a1be6c47f0f4c9
So when other function use it (like is_ext_imagick()), the result is wrong (due to duplicate path):
@exec($conf['ext_imagick_dir'].pwg_image::get_ext_imagick_command().' -version', $returnarray);The function should be probably like this:
After this change the external ImageMagick is shown.
Thank you.