Skip to content

Commit

Permalink
Correct version checking for canny edge image.
Browse files Browse the repository at this point in the history
  • Loading branch information
Danack committed Jun 19, 2024
1 parent 944b67f commit 4a7e955
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Imagick.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions Imagick_arginfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions imagick_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions php_imagemagick_version_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4a7e955

Please sign in to comment.