diff --git a/Imagick.stub.php b/Imagick.stub.php index a105e36a..2130a2b6 100644 --- a/Imagick.stub.php +++ b/Imagick.stub.php @@ -1421,7 +1421,7 @@ public function setImageMask(Imagick $clip_mask, int $pixelmask): void {} // int $channel = Imagick::CHANNEL_DEFAULT): null {} -#if MagickLibVersion >= 0x709 +#if IM_HAVE_IMAGICK_CANNYEDGEIMAGE public function cannyEdgeImage( float $radius, float $sigma, diff --git a/Imagick_arginfo.h b/Imagick_arginfo.h index 9819a3ae..7ce549f3 100644 --- a/Imagick_arginfo.h +++ b/Imagick_arginfo.h @@ -5248,7 +5248,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageMask, 0, 0, 2) ZEND_END_ARG_INFO() #endif -#if MagickLibVersion >= 0x709 +#if IM_HAVE_IMAGICK_CANNYEDGEIMAGE #if PHP_VERSION_ID >= 80000 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_cannyEdgeImage, 0, 4, _IS_BOOL, 0) @@ -6482,7 +6482,7 @@ ZEND_METHOD(Imagick, getImageMask); #if IM_HAVE_IMAGICK_GETSETIMAGEMASK ZEND_METHOD(Imagick, setImageMask); #endif -#if MagickLibVersion >= 0x709 +#if IM_HAVE_IMAGICK_CANNYEDGEIMAGE ZEND_METHOD(Imagick, cannyEdgeImage); #endif #if IM_HAVE_IMAGICK_SETSEED @@ -7207,7 +7207,7 @@ static const zend_function_entry class_Imagick_methods[] = { #if IM_HAVE_IMAGICK_GETSETIMAGEMASK ZEND_ME(Imagick, setImageMask, arginfo_class_Imagick_setImageMask, ZEND_ACC_PUBLIC) #endif -#if MagickLibVersion >= 0x709 +#if IM_HAVE_IMAGICK_CANNYEDGEIMAGE ZEND_ME(Imagick, cannyEdgeImage, arginfo_class_Imagick_cannyEdgeImage, ZEND_ACC_PUBLIC) #endif #if IM_HAVE_IMAGICK_SETSEED diff --git a/imagick_class.c b/imagick_class.c index 22395b63..7fca9f7f 100644 --- a/imagick_class.c +++ b/imagick_class.c @@ -13544,7 +13544,7 @@ PHP_METHOD(Imagick, setImageMask) -#if MagickLibVersion >= 0x709 +#if IM_HAVE_IMAGICK_CANNYEDGEIMAGE /* {{{ proto void Imagick::cannyEdgeImage(float $radius, float $sigma, float $lower_percent, float $upper_percent */ PHP_METHOD(Imagick, cannyEdgeImage) @@ -13579,7 +13579,7 @@ PHP_METHOD(Imagick, cannyEdgeImage) RETURN_TRUE; } /* }}} */ -#endif // MagickLibVersion >= 0x709 +#endif // IM_HAVE_IMAGICK_CANNYEDGEIMAGE #if IM_HAVE_IMAGICK_SETSEED /* {{{ proto void Imagick::setSeed(int seed) diff --git a/php_imagemagick_version_defs.h b/php_imagemagick_version_defs.h index 4b6efe3b..b6f61632 100644 --- a/php_imagemagick_version_defs.h +++ b/php_imagemagick_version_defs.h @@ -34,6 +34,16 @@ #endif +#if MagickLibVersion >= 0x700 + #if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_CANNYEDGEIMAGE 1 + #endif +#elif MagickLibVersion >= 0x690 + // This may actually be available from 6.8.10, but both versions are ancient + #define IM_HAVE_IMAGICK_CANNYEDGEIMAGE 1 +#endif + + #if MagickLibVersion >= 0x709 #define IM_HAVE_IMAGICK_SETSEED 1 #endif