From 4d253fed9a0b889ac5df1098c4eabe27eaf939cd Mon Sep 17 00:00:00 2001 From: Danack Date: Fri, 9 Feb 2024 11:45:49 +0000 Subject: [PATCH] Add missing constants. --- ChangeLog | 2 +- imagick_helpers.c | 15 ++++++++++++++- util/check_for_missing_enums.php | 4 +++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d97c3c1..da204bdc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,7 +4,7 @@ Unreleased * You can now pass null to ImagickDraw::setStrokeDashArray() to reset the dash array. - Added: * function Imagick::clutImageWithInterpolate(Imagick $lookup_table, int $pixel_interpolate_method): bool {} - * Constants Imagick::COMPRESSION_BC5, Imagick::COMPRESSION_BC7 + * Constants Imagick::COMPRESSION_BC5, Imagick::COMPRESSION_BC7, Imagick::COMPRESSION_LERC, Imagick::DIRECTION_TOP_TO_BOTTOM 3.7.0 - Added: diff --git a/imagick_helpers.c b/imagick_helpers.c index 9e4d520d..ca437bc3 100644 --- a/imagick_helpers.c +++ b/imagick_helpers.c @@ -1289,6 +1289,11 @@ void php_imagick_initialize_constants(TSRMLS_D) #if MagickLibVersion >= 0x70C IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DWAA", DWAACompression); IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DWAB", DWABCompression); + + +#if MagickLibVersion >= 0x712 + // actually 7.1.1-16, but still can't test patch versions + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_LERC", LERCCompression); #endif IMAGICK_REGISTER_CONST_LONG("PAINT_POINT", PointMethod); @@ -1554,7 +1559,9 @@ void php_imagick_initialize_constants(TSRMLS_D) #endif -#if MagickLibVersion >= 0x720 +#if MagickLibVersion >= 0x712 + // Technically >= 7.1.1-9 but we still don't have a mechanism for + // detecting patch versions. IMAGICK_REGISTER_CONST_LONG("COLORSPACE_OKLAB", OklabColorspace); IMAGICK_REGISTER_CONST_LONG("COLORSPACE_OKLCH", OklchColorspace); #endif @@ -1956,6 +1963,12 @@ IMAGICK_REGISTER_CONST_LONG("KERNEL_BINOMIAL", BinomialKernel); IMAGICK_REGISTER_CONST_LONG("DIRECTION_LEFT_TO_RIGHT", LeftToRightDirection); IMAGICK_REGISTER_CONST_LONG("DIRECTION_RIGHT_TO_LEFT", RightToLeftDirection); +#if MagickLibVersion >= 0x712 + // Technically >= 7.1.1-14 but we still don't have a mechanism for + // detecting patch versions. + IMAGICK_REGISTER_CONST_LONG("DIRECTION_TOP_TO_BOTTOM", TopToBottomDirection); +#endif + // The kernel is scaled directly using given scaling factor without change. IMAGICK_REGISTER_CONST_LONG("NORMALIZE_KERNEL_NONE", 0); // Kernel normalization ('normalize_flags' given) is designed to ensure diff --git a/util/check_for_missing_enums.php b/util/check_for_missing_enums.php index b331b772..a4736e1a 100644 --- a/util/check_for_missing_enums.php +++ b/util/check_for_missing_enums.php @@ -158,6 +158,9 @@ 'MagickCore/cache-view.h' => [ 'VirtualPixelMethod', ], + 'MagickCore/channel.h' => [ + 'AlphaChannelOption', + ], 'MagickCore/compare.h' => [ 'MetricType', ], @@ -194,7 +197,6 @@ 'GravityType', ], 'MagickCore/image.h' => [ - 'AlphaChannelOption', 'ImageType', 'InterlaceType', 'OrientationType',