ImageMagick
-
Hi. I checked your ImageMagick generation code. Many Imagick older versions should work when supporting AVIF generation, now I generated AVIF with ImageMagick 6.9.11-60.
You should check not the version but for Imagick, a simple example that I checked for some old installations:$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 topic was modified 6 months, 3 weeks ago by .
- This topic was modified 6 months, 3 weeks ago by .
- This topic was modified 6 months, 3 weeks ago by .
- This topic was modified 6 months, 3 weeks ago by .
The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.