Does the AVIF support for Modern Image Formats only check if ImageMagick 7.0.25 or greater is installed? What would it take to support the GD Extension?
]]>$imagick = new Imagick();
$formats = $imagick->queryFormats();
if (in_array('AVIF', $formats)) {
echo "AVIF support is available.";
} else {
echo "AVIF support is not available.";
}
Also, your plugin is working with WordPress 6.5.2, PHP 8.0, and PHP 8.1, but breaks Oxygen Page Builder, and maybe other page builders, but I attached functions.php shortcode to disable your plugin on Front-end editors like Oxygen. For example, you can implement that in your version check, to enhance compatible installations, also your syntax is compatible with much older ImageMagick, so when AVIF if supported, so should work.
/**
* storing imageMagick version
*/
if (!defined('AVIFE_IMAGICK_VER')) {
if (class_exists('Imagick')) {
$v = Imagick::getVersion();
$imagick = new Imagick();
$formats = $imagick->queryFormats();
preg_match('/ImageMagick ([0-9]+\.[0-9]+\.[0-9]+)/', $v['versionString'], $v);
if (version_compare($v[1], '7.0.25') >= 0) {
define('AVIFE_IMAGICK_VER', $v[1]);
} elseif (in_array('AVIF', $formats)) {// check AVIF support on older ImageMagick
define('AVIFE_IMAGICK_VER', $v[1]);
}
else {
define('AVIFE_IMAGICK_VER', 0);
}
} else {
define('AVIFE_IMAGICK_VER', 0);
}
}
]]>This plugin only works on servers running ImageMagick 7 or above. ImageMagick is installed, but does not support HEIC. Oldest version with HEIC support is 7.0.8-46. Installed version is ImageMagick 7.1.0-2 Q16 x86_64 2021-06-25 https://imagemagick.org
]]>First Question, what does ImageMagick exactly do at WordPress. I think it is the working software for pictures at wordpress in the mediathek and it has got better options than the GD-Library, therefore it is the better way. Do I see that correctly?
Question two, if i will install the plugin, have I to run the plugin as a PHP-Modul not from the command-line, provided it is already installed at the directory usr/bin ?
Would be nice to get a soon answer
thanks
Alfons from Germany