--- /dev/null
+diff -urNpa imagick-3.7.0/Imagick_arginfo.h imagick/Imagick_arginfo.h
+--- imagick-3.7.0/Imagick_arginfo.h 2022-01-11 16:23:47.000000000 +0100
++++ imagick/Imagick_arginfo.h 2024-12-25 12:17:14.031591684 +0100
+@@ -849,6 +849,24 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
++#if MagickLibVersion > 0x635 && MagickLibVersion >= 0x700
++
++#if PHP_VERSION_ID >= 80000
++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_clutImageWithInterpolate, 0, 2, _IS_BOOL, 0)
++#else
++ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_clutImageWithInterpolate, 0, 0, 2)
++#endif
++
++ ZEND_ARG_OBJ_INFO(0, lookup_table, Imagick, 0)
++
++#if PHP_VERSION_ID >= 80000
++ ZEND_ARG_TYPE_INFO(0, pixel_interpolate_method, IS_LONG, 0)
++#else
++ ZEND_ARG_INFO(0, pixel_interpolate_method)
++#endif
++ZEND_END_ARG_INFO()
++#endif
++
+ #if MagickLibVersion > 0x635
+
+ #if PHP_VERSION_ID >= 80000
+@@ -4515,6 +4533,36 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
++#if MagickLibVersion >= 0x700
++
++#if PHP_VERSION_ID >= 80000
++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageBluePrimary, 0, 3, _IS_BOOL, 0)
++#else
++ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageBluePrimary, 0, 0, 3)
++#endif
++
++
++#if PHP_VERSION_ID >= 80000
++ ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0)
++#else
++ ZEND_ARG_INFO(0, x)
++#endif
++
++#if PHP_VERSION_ID >= 80000
++ ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0)
++#else
++ ZEND_ARG_INFO(0, y)
++#endif
++
++#if PHP_VERSION_ID >= 80000
++ ZEND_ARG_TYPE_INFO(0, z, IS_DOUBLE, 0)
++#else
++ ZEND_ARG_INFO(0, z)
++#endif
++ZEND_END_ARG_INFO()
++#endif
++
++#if !(MagickLibVersion >= 0x700)
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageBluePrimary, 0, 2, _IS_BOOL, 0)
+@@ -4535,6 +4583,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_ARG_INFO(0, y)
+ #endif
+ ZEND_END_ARG_INFO()
++#endif
+
+
+ #if PHP_VERSION_ID >= 80000
+@@ -4615,7 +4664,13 @@ ZEND_END_ARG_INFO()
+
+ #define arginfo_class_Imagick_setImageExtent arginfo_class_Imagick_sampleImage
+
++#if MagickLibVersion >= 0x700
++#define arginfo_class_Imagick_setImageGreenPrimary arginfo_class_Imagick_setImageBluePrimary
++#endif
++
++#if !(MagickLibVersion >= 0x700)
+ #define arginfo_class_Imagick_setImageGreenPrimary arginfo_class_Imagick_setImageBluePrimary
++#endif
+
+
+ #if PHP_VERSION_ID >= 80000
+@@ -4653,7 +4708,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ #endif
+ ZEND_END_ARG_INFO()
+
++#if MagickLibVersion >= 0x700
++#define arginfo_class_Imagick_setImageRedPrimary arginfo_class_Imagick_setImageBluePrimary
++#endif
++
++#if !(MagickLibVersion >= 0x700)
+ #define arginfo_class_Imagick_setImageRedPrimary arginfo_class_Imagick_setImageBluePrimary
++#endif
+
+
+ #if PHP_VERSION_ID >= 80000
+@@ -4685,7 +4746,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ #endif
+ ZEND_END_ARG_INFO()
+
++#if MagickLibVersion >= 0x700
+ #define arginfo_class_Imagick_setImageWhitePoint arginfo_class_Imagick_setImageBluePrimary
++#endif
++
++#if !(MagickLibVersion >= 0x700)
++#define arginfo_class_Imagick_setImageWhitePoint arginfo_class_Imagick_setImageBluePrimary
++#endif
+
+
+ #if PHP_VERSION_ID >= 80000
+@@ -5030,31 +5097,16 @@ ZEND_END_ARG_INFO()
+ #define arginfo_class_Imagick_key arginfo_class_Imagick_getSizeOffset
+ #endif
+
+-#if MagickLibVersion > 0x628
+ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_next, 0, 0, IS_VOID, 0)
+ ZEND_END_ARG_INFO()
+-#endif
+
+-#if MagickLibVersion > 0x628
+ #define arginfo_class_Imagick_rewind arginfo_class_Imagick_next
+-#endif
+
+-#if MagickLibVersion > 0x628
+-#define arginfo_class_Imagick_valid arginfo_class_Imagick_optimizeImageLayers
+-#endif
++#define arginfo_class_Imagick_valid arginfo_class_Imagick_removeImage
+
+-#if MagickLibVersion > 0x628
++#define arginfo_class_Imagick_current arginfo_class_Imagick_clone
+
+-#if PHP_VERSION_ID >= 80000
+-ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_current, 0, 0, Imagick, 0)
+-#else
+-ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_current, 0, 0, 0)
+-#endif
+-
+-ZEND_END_ARG_INFO()
+-#endif
+-
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x659
++#if MagickLibVersion >= 0x659
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_brightnessContrastImage, 0, 2, _IS_BOOL, 0)
+@@ -5078,7 +5130,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && MagickLibVersion > 0x661
++#if MagickLibVersion > 0x661
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_colorMatrixImage, 0, 1, _IS_BOOL, 0)
+@@ -5095,7 +5147,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_selectiveBlurImage, 0, 3, _IS_BOOL, 0)
+@@ -5123,9 +5174,8 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ #endif
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT")
+ ZEND_END_ARG_INFO()
+-#endif
+
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x689
++#if MagickLibVersion >= 0x689
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_rotationalBlurImage, 0, 1, _IS_BOOL, 0)
+@@ -5143,7 +5193,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x683
++#if MagickLibVersion >= 0x683
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_statisticImage, 0, 3, _IS_BOOL, 0)
+@@ -5173,7 +5223,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x652
++#if MagickLibVersion >= 0x652
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_subimageMatch, 0, 1, Imagick, 0)
+@@ -5207,62 +5257,17 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x652
++#if MagickLibVersion >= 0x652
+ #define arginfo_class_Imagick_similarityImage arginfo_class_Imagick_subimageMatch
+ #endif
+
+-#if MagickLibVersion > 0x628
+-
+-#if PHP_VERSION_ID >= 80000
+-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setRegistry, 0, 2, _IS_BOOL, 0)
+-#else
+-ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setRegistry, 0, 0, 2)
+-#endif
+-
+-
+-#if PHP_VERSION_ID >= 80000
+- ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
+-#else
+- ZEND_ARG_INFO(0, key)
+-#endif
+-
+-#if PHP_VERSION_ID >= 80000
+- ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0)
+-#else
+- ZEND_ARG_INFO(0, value)
+-#endif
+-ZEND_END_ARG_INFO()
+-#endif
+-
+-#if MagickLibVersion > 0x628
+-
+-#if PHP_VERSION_ID >= 80000
+-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getRegistry, 0, 1, IS_STRING, 0)
+-#else
+-ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getRegistry, 0, 0, 1)
+-#endif
+-
+-
+-#if PHP_VERSION_ID >= 80000
+- ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
+-#else
+- ZEND_ARG_INFO(0, key)
+-#endif
+-ZEND_END_ARG_INFO()
+-#endif
+-
+-#if MagickLibVersion > 0x628
++#define arginfo_class_Imagick_setRegistry arginfo_class_Imagick_setOption
+
+-#if PHP_VERSION_ID >= 80000
+-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_listRegistry, 0, 0, IS_ARRAY, 0)
+-#else
+-ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_listRegistry, 0, 0, 0)
+-#endif
++#define arginfo_class_Imagick_getRegistry arginfo_class_Imagick_getOption
+
+-ZEND_END_ARG_INFO()
+-#endif
++#define arginfo_class_Imagick_listRegistry arginfo_class_Imagick_getImageGeometry
+
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x680
++#if MagickLibVersion >= 0x680
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_morphology, 0, 3, _IS_BOOL, 0)
+@@ -5287,7 +5292,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && defined(IMAGICK_WITH_KERNEL) && MagickLibVersion < 0x700
++#if defined(IMAGICK_WITH_KERNEL) && MagickLibVersion < 0x700
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_filter, 0, 1, _IS_BOOL, 0)
+@@ -5300,7 +5305,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setAntialias, 0, 1, IS_VOID, 0)
+@@ -5315,13 +5319,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_ARG_INFO(0, antialias)
+ #endif
+ ZEND_END_ARG_INFO()
+-#endif
+
+-#if MagickLibVersion > 0x628
+-#define arginfo_class_Imagick_getAntialias arginfo_class_Imagick_optimizeImageLayers
+-#endif
++#define arginfo_class_Imagick_getAntialias arginfo_class_Imagick_removeImage
+
+-#if MagickLibVersion > 0x628 && MagickLibVersion > 0x676
++#if MagickLibVersion > 0x676
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_colorDecisionListImage, 0, 1, _IS_BOOL, 0)
+@@ -5338,7 +5339,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x687
++#if MagickLibVersion >= 0x687
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_optimizeImageTransparency, 0, 0, IS_VOID, 0)
+@@ -5349,7 +5350,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x660
++#if MagickLibVersion >= 0x660
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_autoGammaImage, 0, 0, IS_VOID, 0)
+@@ -5361,7 +5362,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692
++#if MagickLibVersion >= 0x692
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_autoOrient, 0, 0, IS_VOID, 0)
+@@ -5372,11 +5373,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692
++#if MagickLibVersion >= 0x692
+ #define arginfo_class_Imagick_autoOrientate arginfo_class_Imagick_autoOrient
+ #endif
+
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692
++#if MagickLibVersion >= 0x692
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_compositeImageGravity, 0, 3, _IS_BOOL, 0)
+@@ -5400,7 +5401,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x693
++#if MagickLibVersion >= 0x693
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_localContrastImage, 0, 2, IS_VOID, 0)
+@@ -5423,7 +5424,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x700
++#if MagickLibVersion >= 0x700
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_identifyImageType, 0, 0, IS_LONG, 0)
+@@ -5434,7 +5435,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GETSETIMAGEMASK
++#if IM_HAVE_IMAGICK_GETSETIMAGEMASK
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getImageMask, 0, 1, Imagick, 1)
+@@ -5451,7 +5452,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GETSETIMAGEMASK
++#if IM_HAVE_IMAGICK_GETSETIMAGEMASK
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageMask, 0, 2, IS_VOID, 0)
+@@ -5469,7 +5470,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x709
++#if MagickLibVersion >= 0x709
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_cannyEdgeImage, 0, 4, _IS_BOOL, 0)
+@@ -5504,7 +5505,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SETSEED
++#if IM_HAVE_IMAGICK_SETSEED
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setSeed, 0, 1, IS_VOID, 0)
+@@ -5521,7 +5522,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE
++#if IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_waveletDenoiseImage, 0, 2, _IS_BOOL, 0)
+@@ -5544,7 +5545,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_MEANSHIFTIMAGE
++#if IM_HAVE_IMAGICK_MEANSHIFTIMAGE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_meanShiftImage, 0, 3, _IS_BOOL, 0)
+@@ -5573,7 +5574,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_KMEANSIMAGE
++#if IM_HAVE_IMAGICK_KMEANSIMAGE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_kmeansImage, 0, 3, _IS_BOOL, 0)
+@@ -5602,7 +5603,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE
++#if IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_rangeThresholdImage, 0, 4, _IS_BOOL, 0)
+@@ -5637,7 +5638,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE
++#if IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_autoThresholdImage, 0, 1, _IS_BOOL, 0)
+@@ -5654,7 +5655,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_BILATERALBLURIMAGE
++#if IM_HAVE_IMAGICK_BILATERALBLURIMAGE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_bilateralBlurImage, 0, 4, _IS_BOOL, 0)
+@@ -5689,7 +5690,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_CLAHEIMAGE
++#if IM_HAVE_IMAGICK_CLAHEIMAGE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_claheImage, 0, 4, _IS_BOOL, 0)
+@@ -5724,7 +5725,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_CHANNELFXIMAGE
++#if IM_HAVE_IMAGICK_CHANNELFXIMAGE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_channelFxImage, 0, 1, Imagick, 0)
+@@ -5741,7 +5742,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE
++#if IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_colorThresholdImage, 0, 2, _IS_BOOL, 0)
+@@ -5754,7 +5755,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_COMPLEXIMAGES
++#if IM_HAVE_IMAGICK_COMPLEXIMAGES
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_complexImages, 0, 1, Imagick, 0)
+@@ -5771,7 +5772,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE
++#if IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_interpolativeResizeImage, 0, 3, _IS_BOOL, 0)
+@@ -5800,7 +5801,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_LEVELIMAGECOLORS
++#if IM_HAVE_IMAGICK_LEVELIMAGECOLORS
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_levelImageColors, 0, 3, _IS_BOOL, 0)
+@@ -5819,7 +5820,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_LEVELIZEIMAGE
++#if IM_HAVE_IMAGICK_LEVELIZEIMAGE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_levelizeImage, 0, 3, _IS_BOOL, 0)
+@@ -5848,7 +5849,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE
++#if IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_orderedDitherImage, 0, 1, _IS_BOOL, 0)
+@@ -5865,7 +5866,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_WHITEBALANCEIMAGE
++#if IM_HAVE_IMAGICK_WHITEBALANCEIMAGE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_whiteBalanceImage, 0, 0, _IS_BOOL, 0)
+@@ -5876,7 +5877,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_DELETE_OPTION
++#if IM_HAVE_IMAGICK_DELETE_OPTION
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_deleteOption, 0, 1, _IS_BOOL, 0)
+@@ -5893,7 +5894,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR
++#if IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getBackgroundColor, 0, 0, ImagickPixel, 0)
+@@ -5904,7 +5905,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS
++#if IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageArtifacts, 0, 0, IS_ARRAY, 0)
+@@ -5916,7 +5917,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS
++#if IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageKurtosis, 0, 0, IS_ARRAY, 0)
+@@ -5927,7 +5928,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_MEAN
++#if IM_HAVE_IMAGICK_GET_IMAGE_MEAN
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageMean, 0, 0, IS_ARRAY, 0)
+@@ -5938,7 +5939,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_RANGE
++#if IM_HAVE_IMAGICK_GET_IMAGE_RANGE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageRange, 0, 0, IS_ARRAY, 0)
+@@ -5949,7 +5950,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD
++#if IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getInterpolateMethod, 0, 0, IS_LONG, 0)
+@@ -5960,7 +5961,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_OPTIONS
++#if IM_HAVE_IMAGICK_GET_OPTIONS
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getOptions, 0, 0, IS_ARRAY, 0)
+@@ -5972,7 +5973,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_ORIENTATION
++#if IM_HAVE_IMAGICK_GET_ORIENTATION
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getOrientation, 0, 0, IS_LONG, 0)
+@@ -5983,7 +5984,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_RESOLUTION
++#if IM_HAVE_IMAGICK_GET_RESOLUTION
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getResolution, 0, 0, IS_ARRAY, 0)
+@@ -5994,7 +5995,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_TYPE
++#if IM_HAVE_IMAGICK_GET_TYPE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getType, 0, 0, IS_LONG, 0)
+@@ -6005,7 +6006,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE
++#if IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_polynomialImage, 0, 1, _IS_BOOL, 0)
+@@ -6022,7 +6023,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_DEPTH
++#if IM_HAVE_IMAGICK_SET_DEPTH
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setDepth, 0, 1, _IS_BOOL, 0)
+@@ -6039,7 +6040,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_EXTRACT
++#if IM_HAVE_IMAGICK_SET_EXTRACT
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setExtract, 0, 1, _IS_BOOL, 0)
+@@ -6056,7 +6057,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD
++#if IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setInterpolateMethod, 0, 1, _IS_BOOL, 0)
+@@ -6073,7 +6074,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+ ZEND_END_ARG_INFO()
+ #endif
+
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_ORIENTATION
++#if IM_HAVE_IMAGICK_SET_ORIENTATION
+
+ #if PHP_VERSION_ID >= 80000
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setOrientation, 0, 1, _IS_BOOL, 0)
+@@ -6223,6 +6224,9 @@ ZEND_METHOD(Imagick, paintFloodfillImage
+ #if MagickLibVersion > 0x635
+ ZEND_METHOD(Imagick, clutImage);
+ #endif
++#if MagickLibVersion > 0x635 && MagickLibVersion >= 0x700
++ZEND_METHOD(Imagick, clutImageWithInterpolate);
++#endif
+ #if MagickLibVersion > 0x635
+ ZEND_METHOD(Imagick, getImageProperties);
+ #endif
+@@ -6640,20 +6644,40 @@ ZEND_METHOD(Imagick, setImageBias);
+ #if MagickLibVersion < 0x700
+ ZEND_METHOD(Imagick, setImageBiasQuantum);
+ #endif
++#if MagickLibVersion >= 0x700
++ZEND_METHOD(Imagick, setImageBluePrimary);
++#endif
++#if !(MagickLibVersion >= 0x700)
+ ZEND_METHOD(Imagick, setImageBluePrimary);
++#endif
+ ZEND_METHOD(Imagick, setImageBorderColor);
+ ZEND_METHOD(Imagick, setImageChannelDepth);
+ ZEND_METHOD(Imagick, setImageColormapColor);
+ ZEND_METHOD(Imagick, setImageColorspace);
+ ZEND_METHOD(Imagick, setImageDispose);
+ ZEND_METHOD(Imagick, setImageExtent);
++#if MagickLibVersion >= 0x700
+ ZEND_METHOD(Imagick, setImageGreenPrimary);
++#endif
++#if !(MagickLibVersion >= 0x700)
++ZEND_METHOD(Imagick, setImageGreenPrimary);
++#endif
+ ZEND_METHOD(Imagick, setImageInterlaceScheme);
+ ZEND_METHOD(Imagick, setImageProfile);
++#if MagickLibVersion >= 0x700
+ ZEND_METHOD(Imagick, setImageRedPrimary);
++#endif
++#if !(MagickLibVersion >= 0x700)
++ZEND_METHOD(Imagick, setImageRedPrimary);
++#endif
+ ZEND_METHOD(Imagick, setImageRenderingIntent);
+ ZEND_METHOD(Imagick, setImageVirtualPixelMethod);
++#if MagickLibVersion >= 0x700
+ ZEND_METHOD(Imagick, setImageWhitePoint);
++#endif
++#if !(MagickLibVersion >= 0x700)
++ZEND_METHOD(Imagick, setImageWhitePoint);
++#endif
+ ZEND_METHOD(Imagick, sigmoidalContrastImage);
+ ZEND_METHOD(Imagick, stereoImage);
+ ZEND_METHOD(Imagick, textureImage);
+@@ -6701,181 +6725,159 @@ ZEND_METHOD(Imagick, setResolution);
+ ZEND_METHOD(Imagick, setSamplingFactors);
+ ZEND_METHOD(Imagick, setSize);
+ ZEND_METHOD(Imagick, setType);
+-#if MagickLibVersion > 0x628
+-ZEND_METHOD(Imagick, nextImage);
+-#endif
+-#if MagickLibVersion > 0x628
+-ZEND_METHOD(Imagick, setFirstIterator);
+-#endif
+-#if MagickLibVersion > 0x628
+ ZEND_METHOD(Imagick, valid);
+-#endif
+-#if MagickLibVersion > 0x628
+ ZEND_METHOD(Imagick, current);
+-#endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x659
++#if MagickLibVersion >= 0x659
+ ZEND_METHOD(Imagick, brightnessContrastImage);
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion > 0x661
++#if MagickLibVersion > 0x661
+ ZEND_METHOD(Imagick, colorMatrixImage);
+ #endif
+-#if MagickLibVersion > 0x628
+ ZEND_METHOD(Imagick, selectiveBlurImage);
+-#endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x689
++#if MagickLibVersion >= 0x689
+ ZEND_METHOD(Imagick, rotationalBlurImage);
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x683
++#if MagickLibVersion >= 0x683
+ ZEND_METHOD(Imagick, statisticImage);
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x652
++#if MagickLibVersion >= 0x652
+ ZEND_METHOD(Imagick, subimageMatch);
+ #endif
+-#if MagickLibVersion > 0x628
+ ZEND_METHOD(Imagick, setRegistry);
+-#endif
+-#if MagickLibVersion > 0x628
+ ZEND_METHOD(Imagick, getRegistry);
+-#endif
+-#if MagickLibVersion > 0x628
+ ZEND_METHOD(Imagick, listRegistry);
+-#endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x680
++#if MagickLibVersion >= 0x680
+ ZEND_METHOD(Imagick, morphology);
+ #endif
+-#if MagickLibVersion > 0x628 && defined(IMAGICK_WITH_KERNEL) && MagickLibVersion < 0x700
++#if defined(IMAGICK_WITH_KERNEL) && MagickLibVersion < 0x700
+ ZEND_METHOD(Imagick, filter);
+ #endif
+-#if MagickLibVersion > 0x628
+ ZEND_METHOD(Imagick, setAntialias);
+-#endif
+-#if MagickLibVersion > 0x628
+ ZEND_METHOD(Imagick, getAntialias);
+-#endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion > 0x676
++#if MagickLibVersion > 0x676
+ ZEND_METHOD(Imagick, colorDecisionListImage);
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x687
++#if MagickLibVersion >= 0x687
+ ZEND_METHOD(Imagick, optimizeImageTransparency);
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x660
++#if MagickLibVersion >= 0x660
+ ZEND_METHOD(Imagick, autoGammaImage);
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692
++#if MagickLibVersion >= 0x692
+ ZEND_METHOD(Imagick, autoOrient);
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692
++#if MagickLibVersion >= 0x692
+ ZEND_METHOD(Imagick, compositeImageGravity);
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x693
++#if MagickLibVersion >= 0x693
+ ZEND_METHOD(Imagick, localContrastImage);
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x700
++#if MagickLibVersion >= 0x700
+ ZEND_METHOD(Imagick, identifyImageType);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GETSETIMAGEMASK
++#if IM_HAVE_IMAGICK_GETSETIMAGEMASK
+ ZEND_METHOD(Imagick, getImageMask);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GETSETIMAGEMASK
++#if IM_HAVE_IMAGICK_GETSETIMAGEMASK
+ ZEND_METHOD(Imagick, setImageMask);
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x709
++#if MagickLibVersion >= 0x709
+ ZEND_METHOD(Imagick, cannyEdgeImage);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SETSEED
++#if IM_HAVE_IMAGICK_SETSEED
+ ZEND_METHOD(Imagick, setSeed);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE
++#if IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE
+ ZEND_METHOD(Imagick, waveletDenoiseImage);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_MEANSHIFTIMAGE
++#if IM_HAVE_IMAGICK_MEANSHIFTIMAGE
+ ZEND_METHOD(Imagick, meanShiftImage);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_KMEANSIMAGE
++#if IM_HAVE_IMAGICK_KMEANSIMAGE
+ ZEND_METHOD(Imagick, kmeansImage);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE
++#if IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE
+ ZEND_METHOD(Imagick, rangeThresholdImage);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE
++#if IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE
+ ZEND_METHOD(Imagick, autoThresholdImage);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_BILATERALBLURIMAGE
++#if IM_HAVE_IMAGICK_BILATERALBLURIMAGE
+ ZEND_METHOD(Imagick, bilateralBlurImage);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_CLAHEIMAGE
++#if IM_HAVE_IMAGICK_CLAHEIMAGE
+ ZEND_METHOD(Imagick, claheImage);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_CHANNELFXIMAGE
++#if IM_HAVE_IMAGICK_CHANNELFXIMAGE
+ ZEND_METHOD(Imagick, channelFxImage);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE
++#if IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE
+ ZEND_METHOD(Imagick, colorThresholdImage);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_COMPLEXIMAGES
++#if IM_HAVE_IMAGICK_COMPLEXIMAGES
+ ZEND_METHOD(Imagick, complexImages);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE
++#if IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE
+ ZEND_METHOD(Imagick, interpolativeResizeImage);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_LEVELIMAGECOLORS
++#if IM_HAVE_IMAGICK_LEVELIMAGECOLORS
+ ZEND_METHOD(Imagick, levelImageColors);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_LEVELIZEIMAGE
++#if IM_HAVE_IMAGICK_LEVELIZEIMAGE
+ ZEND_METHOD(Imagick, levelizeImage);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE
++#if IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE
+ ZEND_METHOD(Imagick, orderedDitherImage);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_WHITEBALANCEIMAGE
++#if IM_HAVE_IMAGICK_WHITEBALANCEIMAGE
+ ZEND_METHOD(Imagick, whiteBalanceImage);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_DELETE_OPTION
++#if IM_HAVE_IMAGICK_DELETE_OPTION
+ ZEND_METHOD(Imagick, deleteOption);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR
++#if IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR
+ ZEND_METHOD(Imagick, getBackgroundColor);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS
++#if IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS
+ ZEND_METHOD(Imagick, getImageArtifacts);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS
++#if IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS
+ ZEND_METHOD(Imagick, getImageKurtosis);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_MEAN
++#if IM_HAVE_IMAGICK_GET_IMAGE_MEAN
+ ZEND_METHOD(Imagick, getImageMean);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_RANGE
++#if IM_HAVE_IMAGICK_GET_IMAGE_RANGE
+ ZEND_METHOD(Imagick, getImageRange);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD
++#if IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD
+ ZEND_METHOD(Imagick, getInterpolateMethod);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_OPTIONS
++#if IM_HAVE_IMAGICK_GET_OPTIONS
+ ZEND_METHOD(Imagick, getOptions);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_ORIENTATION
++#if IM_HAVE_IMAGICK_GET_ORIENTATION
+ ZEND_METHOD(Imagick, getOrientation);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_RESOLUTION
++#if IM_HAVE_IMAGICK_GET_RESOLUTION
+ ZEND_METHOD(Imagick, getResolution);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_TYPE
++#if IM_HAVE_IMAGICK_GET_TYPE
+ ZEND_METHOD(Imagick, getType);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE
++#if IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE
+ ZEND_METHOD(Imagick, polynomialImage);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_DEPTH
++#if IM_HAVE_IMAGICK_SET_DEPTH
+ ZEND_METHOD(Imagick, setDepth);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_EXTRACT
++#if IM_HAVE_IMAGICK_SET_EXTRACT
+ ZEND_METHOD(Imagick, setExtract);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD
++#if IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD
+ ZEND_METHOD(Imagick, setInterpolateMethod);
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_ORIENTATION
++#if IM_HAVE_IMAGICK_SET_ORIENTATION
+ ZEND_METHOD(Imagick, setOrientation);
+ #endif
+
+@@ -7016,6 +7018,9 @@ static const zend_function_entry class_I
+ #if MagickLibVersion > 0x635
+ ZEND_ME(Imagick, clutImage, arginfo_class_Imagick_clutImage, ZEND_ACC_PUBLIC)
+ #endif
++#if MagickLibVersion > 0x635 && MagickLibVersion >= 0x700
++ ZEND_ME(Imagick, clutImageWithInterpolate, arginfo_class_Imagick_clutImageWithInterpolate, ZEND_ACC_PUBLIC)
++#endif
+ #if MagickLibVersion > 0x635
+ ZEND_ME(Imagick, getImageProperties, arginfo_class_Imagick_getImageProperties, ZEND_ACC_PUBLIC)
+ #endif
+@@ -7435,20 +7440,40 @@ static const zend_function_entry class_I
+ #if MagickLibVersion < 0x700
+ ZEND_ME(Imagick, setImageBiasQuantum, arginfo_class_Imagick_setImageBiasQuantum, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED)
+ #endif
++#if MagickLibVersion >= 0x700
+ ZEND_ME(Imagick, setImageBluePrimary, arginfo_class_Imagick_setImageBluePrimary, ZEND_ACC_PUBLIC)
++#endif
++#if !(MagickLibVersion >= 0x700)
++ ZEND_ME(Imagick, setImageBluePrimary, arginfo_class_Imagick_setImageBluePrimary, ZEND_ACC_PUBLIC)
++#endif
+ ZEND_ME(Imagick, setImageBorderColor, arginfo_class_Imagick_setImageBorderColor, ZEND_ACC_PUBLIC)
+ ZEND_ME(Imagick, setImageChannelDepth, arginfo_class_Imagick_setImageChannelDepth, ZEND_ACC_PUBLIC)
+ ZEND_ME(Imagick, setImageColormapColor, arginfo_class_Imagick_setImageColormapColor, ZEND_ACC_PUBLIC)
+ ZEND_ME(Imagick, setImageColorspace, arginfo_class_Imagick_setImageColorspace, ZEND_ACC_PUBLIC)
+ ZEND_ME(Imagick, setImageDispose, arginfo_class_Imagick_setImageDispose, ZEND_ACC_PUBLIC)
+ ZEND_ME(Imagick, setImageExtent, arginfo_class_Imagick_setImageExtent, ZEND_ACC_PUBLIC)
++#if MagickLibVersion >= 0x700
+ ZEND_ME(Imagick, setImageGreenPrimary, arginfo_class_Imagick_setImageGreenPrimary, ZEND_ACC_PUBLIC)
++#endif
++#if !(MagickLibVersion >= 0x700)
++ ZEND_ME(Imagick, setImageGreenPrimary, arginfo_class_Imagick_setImageGreenPrimary, ZEND_ACC_PUBLIC)
++#endif
+ ZEND_ME(Imagick, setImageInterlaceScheme, arginfo_class_Imagick_setImageInterlaceScheme, ZEND_ACC_PUBLIC)
+ ZEND_ME(Imagick, setImageProfile, arginfo_class_Imagick_setImageProfile, ZEND_ACC_PUBLIC)
++#if MagickLibVersion >= 0x700
++ ZEND_ME(Imagick, setImageRedPrimary, arginfo_class_Imagick_setImageRedPrimary, ZEND_ACC_PUBLIC)
++#endif
++#if !(MagickLibVersion >= 0x700)
+ ZEND_ME(Imagick, setImageRedPrimary, arginfo_class_Imagick_setImageRedPrimary, ZEND_ACC_PUBLIC)
++#endif
+ ZEND_ME(Imagick, setImageRenderingIntent, arginfo_class_Imagick_setImageRenderingIntent, ZEND_ACC_PUBLIC)
+ ZEND_ME(Imagick, setImageVirtualPixelMethod, arginfo_class_Imagick_setImageVirtualPixelMethod, ZEND_ACC_PUBLIC)
++#if MagickLibVersion >= 0x700
++ ZEND_ME(Imagick, setImageWhitePoint, arginfo_class_Imagick_setImageWhitePoint, ZEND_ACC_PUBLIC)
++#endif
++#if !(MagickLibVersion >= 0x700)
+ ZEND_ME(Imagick, setImageWhitePoint, arginfo_class_Imagick_setImageWhitePoint, ZEND_ACC_PUBLIC)
++#endif
+ ZEND_ME(Imagick, sigmoidalContrastImage, arginfo_class_Imagick_sigmoidalContrastImage, ZEND_ACC_PUBLIC)
+ ZEND_ME(Imagick, stereoImage, arginfo_class_Imagick_stereoImage, ZEND_ACC_PUBLIC)
+ ZEND_ME(Imagick, textureImage, arginfo_class_Imagick_textureImage, ZEND_ACC_PUBLIC)
+@@ -7499,187 +7524,167 @@ static const zend_function_entry class_I
+ #if MagickLibVersion > 0x628
+ ZEND_MALIAS(Imagick, key, getIteratorIndex, arginfo_class_Imagick_key, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628
+ ZEND_MALIAS(Imagick, next, nextImage, arginfo_class_Imagick_next, ZEND_ACC_PUBLIC)
+-#endif
+-#if MagickLibVersion > 0x628
+ ZEND_MALIAS(Imagick, rewind, setFirstIterator, arginfo_class_Imagick_rewind, ZEND_ACC_PUBLIC)
+-#endif
+-#if MagickLibVersion > 0x628
+ ZEND_ME(Imagick, valid, arginfo_class_Imagick_valid, ZEND_ACC_PUBLIC)
+-#endif
+-#if MagickLibVersion > 0x628
+ ZEND_ME(Imagick, current, arginfo_class_Imagick_current, ZEND_ACC_PUBLIC)
+-#endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x659
++#if MagickLibVersion >= 0x659
+ ZEND_ME(Imagick, brightnessContrastImage, arginfo_class_Imagick_brightnessContrastImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion > 0x661
++#if MagickLibVersion > 0x661
+ ZEND_ME(Imagick, colorMatrixImage, arginfo_class_Imagick_colorMatrixImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628
+ ZEND_ME(Imagick, selectiveBlurImage, arginfo_class_Imagick_selectiveBlurImage, ZEND_ACC_PUBLIC)
+-#endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x689
++#if MagickLibVersion >= 0x689
+ ZEND_ME(Imagick, rotationalBlurImage, arginfo_class_Imagick_rotationalBlurImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x683
++#if MagickLibVersion >= 0x683
+ ZEND_ME(Imagick, statisticImage, arginfo_class_Imagick_statisticImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x652
++#if MagickLibVersion >= 0x652
+ ZEND_ME(Imagick, subimageMatch, arginfo_class_Imagick_subimageMatch, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x652
++#if MagickLibVersion >= 0x652
+ ZEND_MALIAS(Imagick, similarityImage, subimageMatch, arginfo_class_Imagick_similarityImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628
+ ZEND_ME(Imagick, setRegistry, arginfo_class_Imagick_setRegistry, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+-#endif
+-#if MagickLibVersion > 0x628
+ ZEND_ME(Imagick, getRegistry, arginfo_class_Imagick_getRegistry, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+-#endif
+-#if MagickLibVersion > 0x628
+ ZEND_ME(Imagick, listRegistry, arginfo_class_Imagick_listRegistry, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+-#endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x680
++#if MagickLibVersion >= 0x680
+ ZEND_ME(Imagick, morphology, arginfo_class_Imagick_morphology, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && defined(IMAGICK_WITH_KERNEL) && MagickLibVersion < 0x700
++#if defined(IMAGICK_WITH_KERNEL) && MagickLibVersion < 0x700
+ ZEND_ME(Imagick, filter, arginfo_class_Imagick_filter, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED)
+ #endif
+-#if MagickLibVersion > 0x628
+ ZEND_ME(Imagick, setAntialias, arginfo_class_Imagick_setAntialias, ZEND_ACC_PUBLIC)
+-#endif
+-#if MagickLibVersion > 0x628
+ ZEND_ME(Imagick, getAntialias, arginfo_class_Imagick_getAntialias, ZEND_ACC_PUBLIC)
+-#endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion > 0x676
++#if MagickLibVersion > 0x676
+ ZEND_ME(Imagick, colorDecisionListImage, arginfo_class_Imagick_colorDecisionListImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x687
++#if MagickLibVersion >= 0x687
+ ZEND_ME(Imagick, optimizeImageTransparency, arginfo_class_Imagick_optimizeImageTransparency, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x660
++#if MagickLibVersion >= 0x660
+ ZEND_ME(Imagick, autoGammaImage, arginfo_class_Imagick_autoGammaImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692
++#if MagickLibVersion >= 0x692
+ ZEND_ME(Imagick, autoOrient, arginfo_class_Imagick_autoOrient, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692
++#if MagickLibVersion >= 0x692
+ ZEND_MALIAS(Imagick, autoOrientate, autoOrient, arginfo_class_Imagick_autoOrientate, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692
++#if MagickLibVersion >= 0x692
+ ZEND_ME(Imagick, compositeImageGravity, arginfo_class_Imagick_compositeImageGravity, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x693
++#if MagickLibVersion >= 0x693
+ ZEND_ME(Imagick, localContrastImage, arginfo_class_Imagick_localContrastImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x700
++#if MagickLibVersion >= 0x700
+ ZEND_ME(Imagick, identifyImageType, arginfo_class_Imagick_identifyImageType, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GETSETIMAGEMASK
++#if IM_HAVE_IMAGICK_GETSETIMAGEMASK
+ ZEND_ME(Imagick, getImageMask, arginfo_class_Imagick_getImageMask, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GETSETIMAGEMASK
++#if IM_HAVE_IMAGICK_GETSETIMAGEMASK
+ ZEND_ME(Imagick, setImageMask, arginfo_class_Imagick_setImageMask, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x709
++#if MagickLibVersion >= 0x709
+ ZEND_ME(Imagick, cannyEdgeImage, arginfo_class_Imagick_cannyEdgeImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SETSEED
++#if IM_HAVE_IMAGICK_SETSEED
+ ZEND_ME(Imagick, setSeed, arginfo_class_Imagick_setSeed, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE
++#if IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE
+ ZEND_ME(Imagick, waveletDenoiseImage, arginfo_class_Imagick_waveletDenoiseImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_MEANSHIFTIMAGE
++#if IM_HAVE_IMAGICK_MEANSHIFTIMAGE
+ ZEND_ME(Imagick, meanShiftImage, arginfo_class_Imagick_meanShiftImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_KMEANSIMAGE
++#if IM_HAVE_IMAGICK_KMEANSIMAGE
+ ZEND_ME(Imagick, kmeansImage, arginfo_class_Imagick_kmeansImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE
++#if IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE
+ ZEND_ME(Imagick, rangeThresholdImage, arginfo_class_Imagick_rangeThresholdImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE
++#if IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE
+ ZEND_ME(Imagick, autoThresholdImage, arginfo_class_Imagick_autoThresholdImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_BILATERALBLURIMAGE
++#if IM_HAVE_IMAGICK_BILATERALBLURIMAGE
+ ZEND_ME(Imagick, bilateralBlurImage, arginfo_class_Imagick_bilateralBlurImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_CLAHEIMAGE
++#if IM_HAVE_IMAGICK_CLAHEIMAGE
+ ZEND_ME(Imagick, claheImage, arginfo_class_Imagick_claheImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_CHANNELFXIMAGE
++#if IM_HAVE_IMAGICK_CHANNELFXIMAGE
+ ZEND_ME(Imagick, channelFxImage, arginfo_class_Imagick_channelFxImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE
++#if IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE
+ ZEND_ME(Imagick, colorThresholdImage, arginfo_class_Imagick_colorThresholdImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_COMPLEXIMAGES
++#if IM_HAVE_IMAGICK_COMPLEXIMAGES
+ ZEND_ME(Imagick, complexImages, arginfo_class_Imagick_complexImages, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE
++#if IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE
+ ZEND_ME(Imagick, interpolativeResizeImage, arginfo_class_Imagick_interpolativeResizeImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_LEVELIMAGECOLORS
++#if IM_HAVE_IMAGICK_LEVELIMAGECOLORS
+ ZEND_ME(Imagick, levelImageColors, arginfo_class_Imagick_levelImageColors, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_LEVELIZEIMAGE
++#if IM_HAVE_IMAGICK_LEVELIZEIMAGE
+ ZEND_ME(Imagick, levelizeImage, arginfo_class_Imagick_levelizeImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE
++#if IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE
+ ZEND_ME(Imagick, orderedDitherImage, arginfo_class_Imagick_orderedDitherImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_WHITEBALANCEIMAGE
++#if IM_HAVE_IMAGICK_WHITEBALANCEIMAGE
+ ZEND_ME(Imagick, whiteBalanceImage, arginfo_class_Imagick_whiteBalanceImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_DELETE_OPTION
++#if IM_HAVE_IMAGICK_DELETE_OPTION
+ ZEND_ME(Imagick, deleteOption, arginfo_class_Imagick_deleteOption, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR
++#if IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR
+ ZEND_ME(Imagick, getBackgroundColor, arginfo_class_Imagick_getBackgroundColor, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS
++#if IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS
+ ZEND_ME(Imagick, getImageArtifacts, arginfo_class_Imagick_getImageArtifacts, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS
++#if IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS
+ ZEND_ME(Imagick, getImageKurtosis, arginfo_class_Imagick_getImageKurtosis, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_MEAN
++#if IM_HAVE_IMAGICK_GET_IMAGE_MEAN
+ ZEND_ME(Imagick, getImageMean, arginfo_class_Imagick_getImageMean, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_RANGE
++#if IM_HAVE_IMAGICK_GET_IMAGE_RANGE
+ ZEND_ME(Imagick, getImageRange, arginfo_class_Imagick_getImageRange, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD
++#if IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD
+ ZEND_ME(Imagick, getInterpolateMethod, arginfo_class_Imagick_getInterpolateMethod, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_OPTIONS
++#if IM_HAVE_IMAGICK_GET_OPTIONS
+ ZEND_ME(Imagick, getOptions, arginfo_class_Imagick_getOptions, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_ORIENTATION
++#if IM_HAVE_IMAGICK_GET_ORIENTATION
+ ZEND_ME(Imagick, getOrientation, arginfo_class_Imagick_getOrientation, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_RESOLUTION
++#if IM_HAVE_IMAGICK_GET_RESOLUTION
+ ZEND_ME(Imagick, getResolution, arginfo_class_Imagick_getResolution, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_TYPE
++#if IM_HAVE_IMAGICK_GET_TYPE
+ ZEND_ME(Imagick, getType, arginfo_class_Imagick_getType, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE
++#if IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE
+ ZEND_ME(Imagick, polynomialImage, arginfo_class_Imagick_polynomialImage, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_DEPTH
++#if IM_HAVE_IMAGICK_SET_DEPTH
+ ZEND_ME(Imagick, setDepth, arginfo_class_Imagick_setDepth, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_EXTRACT
++#if IM_HAVE_IMAGICK_SET_EXTRACT
+ ZEND_ME(Imagick, setExtract, arginfo_class_Imagick_setExtract, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD
++#if IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD
+ ZEND_ME(Imagick, setInterpolateMethod, arginfo_class_Imagick_setInterpolateMethod, ZEND_ACC_PUBLIC)
+ #endif
+-#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_ORIENTATION
++#if IM_HAVE_IMAGICK_SET_ORIENTATION
+ ZEND_ME(Imagick, setOrientation, arginfo_class_Imagick_setOrientation, ZEND_ACC_PUBLIC)
+ #endif
+ ZEND_FE_END
+diff -urNpa imagick-3.7.0/imagick_class.c imagick/imagick_class.c
+--- imagick-3.7.0/imagick_class.c 2022-01-11 16:23:47.000000000 +0100
++++ imagick/imagick_class.c 2024-12-25 12:17:14.035591731 +0100
+@@ -1392,6 +1392,47 @@ PHP_METHOD(Imagick, clutImage)
+ }
+ /* }}} */
+
++
++#if MagickLibVersion >= 0x700
++/* {{{ proto Imagick Imagick::clutImageWithInterpolate(Imagick lookup, int pixel_interpolate_method)
++ Replaces colors in the image from a color lookup table.
++*/
++PHP_METHOD(Imagick, clutImageWithInterpolate)
++{
++ zval *objvar;
++ php_imagick_object *intern, *lookup;
++ MagickBooleanType status;
++ im_long interpolate_method;
++
++ /* Parse parameters given to function */
++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &objvar, php_imagick_sc_entry, &interpolate_method) == FAILURE) {
++ return;
++ }
++
++ intern = Z_IMAGICK_P(getThis());
++ if (php_imagick_ensure_not_empty (intern->magick_wand) == 0)
++ return;
++
++ lookup = Z_IMAGICK_P(objvar);
++ if (php_imagick_ensure_not_empty (lookup->magick_wand) == 0)
++ return;
++
++ status = MagickClutImage(intern->magick_wand, lookup->magick_wand, interpolate_method);
++
++ /* No magick is going to happen */
++ if (status == MagickFalse) {
++ php_imagick_convert_imagick_exception(
++ intern->magick_wand,
++ "Unable to replace colors in the image from a color lookup table" TSRMLS_CC
++ );
++ return;
++ }
++
++ RETURN_TRUE;
++}
++/* }}} */
++#endif
++
+ /* {{{ proto Imagick Imagick::getImageProperties([string pattern, bool values] )
+ Returns all the property names that match the specified pattern
+ */
+@@ -6231,14 +6272,14 @@ PHP_METHOD(Imagick, unsharpMaskImage)
+
+ intern = Z_IMAGICK_P(getThis());
+ if (php_imagick_ensure_not_empty (intern->magick_wand) == 0)
+- return;
++ RETURN_THROWS();
+
+ status = MagickUnsharpMaskImageChannel(intern->magick_wand, channel, radius, sigma, amount, threshold);
+
+ /* No magick is going to happen */
+ if (status == MagickFalse) {
+ php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to unsharp mask image" TSRMLS_CC);
+- return;
++ RETURN_THROWS();
+ }
+ RETURN_TRUE;
+ }
+@@ -6273,7 +6314,7 @@ PHP_METHOD(Imagick, convolveImage)
+ // No magick is going to happen
+ if (status == MagickFalse) {
+ php_imagick_convert_imagick_exception(intern->magick_wand, "Failed to filter image" TSRMLS_CC);
+- return;
++ RETURN_THROWS();
+ }
+
+ RETURN_TRUE;
+@@ -6301,13 +6342,13 @@ PHP_METHOD(Imagick, convolveImage)
+
+ intern = Z_IMAGICK_P(getThis());
+ if (php_imagick_ensure_not_empty (intern->magick_wand) == 0)
+- return;
++ RETURN_THROWS();
+
+ kernel = php_imagick_zval_to_double_array(kernel_array, &num_elements TSRMLS_CC);
+
+ if (!kernel) {
+ php_imagick_throw_exception(IMAGICK_CLASS, "Unable to read matrix array" TSRMLS_CC);
+- return;
++ RETURN_THROWS();
+ }
+
+ order = (unsigned long) sqrt(num_elements);
+@@ -6317,7 +6358,7 @@ PHP_METHOD(Imagick, convolveImage)
+ /* No magick is going to happen */
+ if (status == MagickFalse) {
+ php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to convolve image" TSRMLS_CC);
+- return;
++ RETURN_THROWS();
+ }
+
+ RETURN_TRUE;
+@@ -6341,14 +6382,14 @@ PHP_METHOD(Imagick, cycleColormapImage)
+
+ intern = Z_IMAGICK_P(getThis());
+ if (php_imagick_ensure_not_empty (intern->magick_wand) == 0)
+- return;
++ RETURN_THROWS();
+
+ status = MagickCycleColormapImage(intern->magick_wand, displace);
+
+ /* No magick is going to happen */
+ if (status == MagickFalse) {
+ php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to cycle image colormap" TSRMLS_CC);
+- return;
++ RETURN_THROWS();
+ }
+
+ RETURN_TRUE;
+@@ -6529,7 +6570,7 @@ PHP_METHOD(Imagick, enhanceImage)
+
+ /* No magick is going to happen */
+ if (status == MagickFalse) {
+- php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to enchance image" TSRMLS_CC);
++ php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to enhance image" TSRMLS_CC);
+ return;
+ }
+
+@@ -6617,7 +6658,7 @@ PHP_METHOD(Imagick, evaluateImages)
+
+ intern = Z_IMAGICK_P(getThis());
+ if (php_imagick_ensure_not_empty (intern->magick_wand) == 0)
+- return;
++ RETURN_THROWS();
+
+ // MagickEvaluateImages appears to crash if index is not zero.
+ #if MagickLibVersion > 0x628
+@@ -6630,7 +6671,7 @@ PHP_METHOD(Imagick, evaluateImages)
+ /* No magick is going to happen */
+ if (status == MagickFalse) {
+ php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set iterator index" TSRMLS_CC);
+- return;
++ RETURN_THROWS();
+ }
+
+ evaluated_wand = MagickEvaluateImages(intern->magick_wand, evaluate_operator);
+@@ -11812,7 +11853,10 @@ PHP_METHOD(Imagick, getConfigureOptions)
+ for (i=0; i<number_options; i++) {
+ option_value = MagickQueryConfigureOption(result[i]);
+ IM_add_assoc_string(return_value, result[i], option_value);
++ DestroyString(result[i]);
++ DestroyString(option_value);
+ }
++ RelinquishMagickMemory(result);
+ }
+ /* }}} */
+
+@@ -14221,8 +14265,11 @@ PHP_METHOD(Imagick, getImageArtifacts)
+ else {
+ IM_add_assoc_string(return_value, artifacts[i], artifact_value);
+ MagickRelinquishMemory(artifact_value);
++ DestroyString(artifact_value);
+ }
++ DestroyString(artifacts[i]);
+ }
++ RelinquishMagickMemory(artifacts);
+ }
+ /* }}} */
+ #endif
+@@ -14381,7 +14428,9 @@ PHP_METHOD(Imagick, getOptions)
+ option_value = MagickGetOption(intern->magick_wand, options[i]);
+ IM_add_assoc_string(return_value, options[i], option_value);
+ MagickRelinquishMemory(option_value);
++ DestroyString(options[i]);
+ }
++ RelinquishMagickMemory(options);
+
+ return;
+ }
+diff -urNpa imagick-3.7.0/ImagickDraw_arginfo.h imagick/ImagickDraw_arginfo.h
+--- imagick-3.7.0/ImagickDraw_arginfo.h 2022-01-11 16:23:47.000000000 +0100
++++ imagick/ImagickDraw_arginfo.h 2024-12-25 12:17:14.027591637 +0100
+@@ -1447,7 +1447,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Ima
+
+
+ #if PHP_VERSION_ID >= 80000
+- ZEND_ARG_TYPE_INFO(0, dashes, IS_ARRAY, 0)
++ ZEND_ARG_TYPE_INFO(0, dashes, IS_ARRAY, 1)
+ #else
+ ZEND_ARG_INFO(0, dashes)
+ #endif
+diff -urNpa imagick-3.7.0/imagickdraw_class.c imagick/imagickdraw_class.c
+--- imagick-3.7.0/imagickdraw_class.c 2022-01-11 16:23:47.000000000 +0100
++++ imagick/imagickdraw_class.c 2024-12-25 12:17:14.035591731 +0100
+@@ -1616,10 +1616,17 @@ PHP_METHOD(ImagickDraw, setStrokeDashArr
+ php_imagickdraw_object *internd;
+
+ /* Parse parameters given to function */
+- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", ¶m_array) == FAILURE) {
++ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!", ¶m_array) == FAILURE) {
+ return;
+ }
+
++ internd = Z_IMAGICKDRAW_P(getThis());
++
++ if (param_array == NULL) {
++ DrawSetStrokeDashArray(internd->drawing_wand, 0, NULL);
++ RETURN_TRUE;
++ }
++
+ double_array = php_imagick_zval_to_double_array(param_array, &elements TSRMLS_CC);
+
+ if (!double_array) {
+@@ -1627,8 +1634,6 @@ PHP_METHOD(ImagickDraw, setStrokeDashArr
+ return;
+ }
+
+- internd = Z_IMAGICKDRAW_P(getThis());
+-
+ DrawSetStrokeDashArray(internd->drawing_wand, elements, double_array);
+ efree(double_array);
+
+diff -urNpa imagick-3.7.0/ImagickDraw.stub.php imagick/ImagickDraw.stub.php
+--- imagick-3.7.0/ImagickDraw.stub.php 2022-01-11 16:23:47.000000000 +0100
++++ imagick/ImagickDraw.stub.php 2024-12-25 12:17:14.027591637 +0100
+@@ -374,7 +374,7 @@ class ImagickDraw
+ public function push(): bool {}
+
+ // A typical stroke dash array might contain the members 5 3 2.
+- public function setStrokeDashArray(array $dashes): bool {}
++ public function setStrokeDashArray(array|null $dashes): bool {}
+
+ #if MagickLibVersion >= 0x693
+ public function getOpacity(): float {}
+diff -urNpa imagick-3.7.0/imagick_helpers.c imagick/imagick_helpers.c
+--- imagick-3.7.0/imagick_helpers.c 2022-01-11 16:23:47.000000000 +0100
++++ imagick/imagick_helpers.c 2024-12-25 12:17:14.035591731 +0100
+@@ -1279,15 +1279,16 @@ void php_imagick_initialize_constants(TS
+ IMAGICK_REGISTER_CONST_LONG("COMPRESSION_WEBP", WebPCompression);
+ #endif
+
+-#if MagickLibVersion >= 0x70C
+- IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DWAA", DWAACompression);
+- IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DWAB", DWABCompression);
+-#endif
+-
+ #if MagickLibVersion >= 0x711
+ // Technically >= 7.1.0-13 but we still don't have a mechanism for
+ // detecting patch versions.
+- IMAGICK_REGISTER_CONST_LONG("COMPRESSION_BC7", BC7Compression);
++ IMAGICK_REGISTER_CONST_LONG("COMPRESSION_BC5", BC5Compression);
++ IMAGICK_REGISTER_CONST_LONG("COMPRESSION_BC7", BC7Compression);
++#endif
++
++#if MagickLibVersion >= 0x70C
++ IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DWAA", DWAACompression);
++ IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DWAB", DWABCompression);
+ #endif
+
+ IMAGICK_REGISTER_CONST_LONG("PAINT_POINT", PointMethod);
+diff -urNpa imagick-3.7.0/ImagickKernel_arginfo.h imagick/ImagickKernel_arginfo.h
+--- imagick-3.7.0/ImagickKernel_arginfo.h 2022-01-11 16:23:47.000000000 +0100
++++ imagick/ImagickKernel_arginfo.h 2024-12-25 12:17:14.027591637 +0100
+@@ -140,27 +140,15 @@ ZEND_METHOD(ImagickKernel, separate);
+ #endif
+
+
+-static const zend_function_entry class_ImagickKernel_methods[] = {
+ #if defined(IMAGICK_WITH_KERNEL)
++static const zend_function_entry class_ImagickKernel_methods[] = {
+ ZEND_ME(ImagickKernel, addKernel, arginfo_class_ImagickKernel_addKernel, ZEND_ACC_PUBLIC)
+-#endif
+-#if defined(IMAGICK_WITH_KERNEL)
+ ZEND_ME(ImagickKernel, addUnityKernel, arginfo_class_ImagickKernel_addUnityKernel, ZEND_ACC_PUBLIC)
+-#endif
+-#if defined(IMAGICK_WITH_KERNEL)
+ ZEND_ME(ImagickKernel, fromBuiltin, arginfo_class_ImagickKernel_fromBuiltin, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+-#endif
+-#if defined(IMAGICK_WITH_KERNEL)
+ ZEND_ME(ImagickKernel, fromMatrix, arginfo_class_ImagickKernel_fromMatrix, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+-#endif
+-#if defined(IMAGICK_WITH_KERNEL)
+ ZEND_ME(ImagickKernel, getMatrix, arginfo_class_ImagickKernel_getMatrix, ZEND_ACC_PUBLIC)
+-#endif
+-#if defined(IMAGICK_WITH_KERNEL)
+ ZEND_ME(ImagickKernel, scale, arginfo_class_ImagickKernel_scale, ZEND_ACC_PUBLIC)
+-#endif
+-#if defined(IMAGICK_WITH_KERNEL)
+ ZEND_ME(ImagickKernel, separate, arginfo_class_ImagickKernel_separate, ZEND_ACC_PUBLIC)
+-#endif
+ ZEND_FE_END
+-};
+\ No newline at end of file
++};
++#endif
+\ No newline at end of file
+diff -urNpa imagick-3.7.0/imagickpixeliterator_class.c imagick/imagickpixeliterator_class.c
+--- imagick-3.7.0/imagickpixeliterator_class.c 2022-01-11 16:23:47.000000000 +0100
++++ imagick/imagickpixeliterator_class.c 2024-12-25 12:17:14.035591731 +0100
+@@ -109,7 +109,7 @@ PHP_METHOD(ImagickPixelIterator, resetIt
+
+ if (!internpix->initialized) {
+ php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC);
+- return;
++ RETURN_THROWS();
+ }
+
+ PixelResetIterator(internpix->pixel_iterator);
+@@ -516,7 +516,7 @@ PHP_METHOD(ImagickPixelIterator, getCurr
+
+ if (!internpix->initialized) {
+ php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC);
+- return;
++ RETURN_THROWS();
+ }
+
+ #if MagickLibVersion <= 0x628
+diff -urNpa imagick-3.7.0/Imagick.stub.php imagick/Imagick.stub.php
+--- imagick-3.7.0/Imagick.stub.php 2022-01-11 16:23:47.000000000 +0100
++++ imagick/Imagick.stub.php 2024-12-25 12:17:14.027591637 +0100
+@@ -200,9 +200,16 @@ class Imagick
+
+ #if MagickLibVersion > 0x635
+
+- // TODO - Imagick
++
+ public function clutImage(Imagick $lookup_table, int $channel = Imagick::CHANNEL_DEFAULT): bool {}
+
++#if MagickLibVersion >= 0x700
++ public function clutImageWithInterpolate(
++ Imagick $lookup_table,
++ int $pixel_interpolate_method // PixelInterpolateMethod
++ ): bool {}
++#endif
++
+ public function getImageProperties(string $pattern = "*", bool $include_values = true): array {}
+
+ public function getImageProfiles(string $pattern = "*", bool $include_values = true): array {}
+@@ -1079,7 +1086,11 @@ class Imagick
+ public function setImageBiasQuantum(string $bias): void {}
+ #endif
+
++#if MagickLibVersion >= 0x700
++ public function setImageBluePrimary(float $x, float $y, float $z): bool {}
++#else
+ public function setImageBluePrimary(float $x, float $y): bool {}
++#endif
+ /* {{{ proto bool Imagick::setImageBluePrimary(float x,float y)
+ For IM7 the prototype is
+ proto bool Imagick::setImageBluePrimary(float x, float y, float z) */
+@@ -1096,21 +1107,33 @@ proto bool Imagick::setImageBluePrimary(
+
+ public function setImageExtent(int $columns, int $rows): bool {}
+
++#if MagickLibVersion >= 0x700
++ public function setImageGreenPrimary(float $x, float $y, float $z): bool {}
++#else
+ public function setImageGreenPrimary(float $x, float $y): bool {}
++#endif
+
+ // INTERLACE_*
+ public function setImageInterlaceScheme(int $interlace): bool {}
+
+ public function setImageProfile(string $name, string $profile): bool {}
+
++#if MagickLibVersion >= 0x700
++ public function setImageRedPrimary(float $x, float $y, float $z): bool {}
++#else
+ public function setImageRedPrimary(float $x, float $y): bool {}
++#endif
+
+ // RENDERINGINTENT
+ public function setImageRenderingIntent(int $rendering_intent): bool {}
+
+ public function setImageVirtualPixelMethod(int $method): bool {}
+
++#if MagickLibVersion >= 0x700
++ public function setImageWhitePoint(float $x, float $y, float $z): bool {}
++#else
+ public function setImageWhitePoint(float $x, float $y): bool {}
++#endif
+
+ public function sigmoidalContrastImage(
+ bool $sharpen,
+@@ -1246,7 +1269,7 @@ proto bool Imagick::setImageBluePrimary(
+ // public function key(): int {}
+ //
+ //# endif
+-//#endif
++#endif
+
+ /** @alias Imagick::nextImage
+ * @tentative-return-type
+diff -urNpa imagick-3.7.0/php_imagick_defs.h imagick/php_imagick_defs.h
+--- imagick-3.7.0/php_imagick_defs.h 2022-01-11 16:23:47.000000000 +0100
++++ imagick/php_imagick_defs.h 2024-12-25 12:17:14.035591731 +0100
+@@ -350,7 +350,11 @@ static inline php_imagickkernel_object *
+ #endif
+
+
+-
++/* RETURN_THROWS() isn't defined in PHP 5.6 through 7.4
++ */
++#if !defined(RETURN_THROWS)
++#define RETURN_THROWS() return
++#endif
+
+
+ /* Define some color constants */
+diff -urNpa imagick-3.7.0/shim_im6_to_im7.c imagick/shim_im6_to_im7.c
+--- imagick-3.7.0/shim_im6_to_im7.c 2022-01-11 16:23:47.000000000 +0100
++++ imagick/shim_im6_to_im7.c 2024-12-25 12:17:14.035591731 +0100
+@@ -181,18 +181,23 @@ MagickBooleanType MagickClampImageChanne
+ }
+
+ return status;
+-
+ }
+
+-MagickBooleanType MagickClutImageChannel(MagickWand *wand, const ChannelType channel, const MagickWand *clut_wand) {
++MagickBooleanType MagickClutImageChannel(
++ MagickWand *wand,
++ const ChannelType channel,
++ const MagickWand *clut_wand
++) {
+ MagickBooleanType status;
+ ChannelType previous_channel_mask;
++ PixelInterpolateMethod pixelInterpolateMethod;
+
+ if (channel != UndefinedChannel) {
+ previous_channel_mask = MagickSetImageChannelMask(wand, channel);
+ }
+- //TODO - need to take parameter
+- status = MagickClutImage(wand, clut_wand, AverageInterpolatePixel);
++
++ pixelInterpolateMethod = MagickGetInterpolateMethod(wand);
++ status = MagickClutImage(wand, clut_wand, pixelInterpolateMethod);
+
+ if (channel != UndefinedChannel) {
+ (void) MagickSetImageChannelMask(wand, previous_channel_mask);