summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2024-02-12 09:47:27 +0100
committerRemi Collet <remi@php.net>2024-02-12 09:47:27 +0100
commit52e6007f62de0dcbf9f20ecafc4e818620fe6093 (patch)
treee8dc26599747384cccdbb6f3849bd2e9d472480e
parent1279d1d9ba0857ec2c8adc52914d4945daa60077 (diff)
add upstream patch for test suite with recent IM versions
-rw-r--r--PHPINFO-im66
-rw-r--r--PHPINFO-im76
-rw-r--r--REFLECTION-im62
-rw-r--r--REFLECTION-im72
-rw-r--r--imagick-tests.patch94
-rw-r--r--php-pecl-imagick.spec13
6 files changed, 111 insertions, 12 deletions
diff --git a/PHPINFO-im6 b/PHPINFO-im6
index ca6c009..ffa8685 100644
--- a/PHPINFO-im6
+++ b/PHPINFO-im6
@@ -4,10 +4,10 @@ imagick
imagick module => enabled
imagick module version => 3.7.0
imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
-Imagick compiled with ImageMagick version => ImageMagick 6.9.13-5 Q16 x86_64 18261 https://legacy.imagemagick.org
-Imagick using ImageMagick library version => ImageMagick 6.9.13-5 Q16 x86_64 18261 https://legacy.imagemagick.org
+Imagick compiled with ImageMagick version => ImageMagick 6.9.13-6 Q16 x86_64 18289 https://legacy.imagemagick.org
+Imagick using ImageMagick library version => ImageMagick 6.9.13-6 Q16 x86_64 18289 https://legacy.imagemagick.org
ImageMagick copyright => (C) 1999 ImageMagick Studio LLC
-ImageMagick release date => 2024-01-21
+ImageMagick release date => 2024-02-11
ImageMagick number of supported formats: => 250
ImageMagick supported formats => 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FLV, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIDEO, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
diff --git a/PHPINFO-im7 b/PHPINFO-im7
index 6770499..be7782a 100644
--- a/PHPINFO-im7
+++ b/PHPINFO-im7
@@ -4,10 +4,10 @@ imagick
imagick module => enabled
imagick module version => 3.7.0
imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
-Imagick compiled with ImageMagick version => ImageMagick 7.1.1-27 Q16-HDRI x86_64 21931 https://imagemagick.org
-Imagick using ImageMagick library version => ImageMagick 7.1.1-27 Q16-HDRI x86_64 21931 https://imagemagick.org
+Imagick compiled with ImageMagick version => ImageMagick 7.1.1-28 Q16-HDRI x86_64 21967 https://imagemagick.org
+Imagick using ImageMagick library version => ImageMagick 7.1.1-28 Q16-HDRI x86_64 21967 https://imagemagick.org
ImageMagick copyright => (C) 1999 ImageMagick Studio LLC
-ImageMagick release date => 2024-01-21
+ImageMagick release date => 2024-02-11
ImageMagick number of supported formats: => 266
ImageMagick supported formats => 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, ASHLAR, AVI, AVIF, AVS, BAYER, BAYERA, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FARBFELD, FAX, FF, FILE, FITS, FL32, FLV, FRACTAL, FTP, FTS, FTXT, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, JXL, K25, KDC, KERNEL, LABEL, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MPO, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORA, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, QOI, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RSVG, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, STRIMG, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YAML, YCbCr, YCbCrA, YUV
diff --git a/REFLECTION-im6 b/REFLECTION-im6
index 5d9ef22..14a9072 100644
--- a/REFLECTION-im6
+++ b/REFLECTION-im6
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #52 imagick version 3.7.0 ] {
+Extension [ <persistent> extension #53 imagick version 3.7.0 ] {
- Dependencies {
Dependency [ gmagick (Conflicts) ]
diff --git a/REFLECTION-im7 b/REFLECTION-im7
index c1ae1a7..bb651b3 100644
--- a/REFLECTION-im7
+++ b/REFLECTION-im7
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #66 imagick version 3.7.0 ] {
+Extension [ <persistent> extension #69 imagick version 3.7.0 ] {
- Dependencies {
Dependency [ gmagick (Conflicts) ]
diff --git a/imagick-tests.patch b/imagick-tests.patch
new file mode 100644
index 0000000..7f6990b
--- /dev/null
+++ b/imagick-tests.patch
@@ -0,0 +1,94 @@
+From 944b67fce68bcb5835999a149f917670555b6fcb Mon Sep 17 00:00:00 2001
+From: Danack <Danack@basereality.com>
+Date: Fri, 9 Feb 2024 13:59:39 +0000
+Subject: [PATCH] Improve test so that is passes.
+
+The underlying maths for some statistics changed: https://github.com/ImageMagick/ImageMagick/issues/6924 so the tests need to pass on both before and after maths.
+---
+ bisect/bisect_analyze.sh | 61 +++++++++++++++++++++++++
+ tests/316_Imagick_getImageKurtosis.phpt | 12 ++++-
+ tests/functions.inc | 40 +++++++++++++++-
+ 3 files changed, 110 insertions(+), 3 deletions(-)
+ create mode 100644 bisect/bisect_analyze.sh
+
+diff --git a/tests/316_Imagick_getImageKurtosis.phpt b/tests/316_Imagick_getImageKurtosis.phpt
+index 2618924a..61370b57 100644
+--- a/tests/316_Imagick_getImageKurtosis.phpt
++++ b/tests/316_Imagick_getImageKurtosis.phpt
+@@ -14,8 +14,16 @@ function getImageKurtosis() {
+ $imagick = new \Imagick(__DIR__ . '/Biter_500.jpg');
+ $values = $imagick->getImageKurtosis();
+
+- check_value($values, "kurtosis", -0.9379261035010518);
+- check_value($values, "skewness", 0.4562517200972045);
++ check_value_posibilities(
++ $values,
++ "kurtosis",
++ [-0.9379261035010518, -0.70925995674921]
++ );
++ check_value_posibilities(
++ $values,
++ "skewness",
++ [0.4562517200972045, 0.56839010636614]
++ );
+ }
+
+ getImageKurtosis() ;
+diff --git a/tests/functions.inc b/tests/functions.inc
+index bbd60ac0..11012864 100644
+--- a/tests/functions.inc
++++ b/tests/functions.inc
+@@ -111,7 +111,10 @@ function setFontForImagickDraw(\ImagickDraw $imagickDraw)
+ $imagickDraw->setFont($font);
+ }
+
+-
++/**
++ * Checks that a named value exists in an array and it matches
++ * an expected value.
++ */
+ function check_value(array $values, $name, $expected_value)
+ {
+ if (array_key_exists($name, $values) !== true) {
+@@ -136,6 +139,41 @@ function check_value(array $values, $name, $expected_value)
+ }
+
+
++/**
++ * Checks that a named value exists in an array and it matches
++ * one of a number of expected values.
++ * This function exists because the expected values for Kurtosis can
++ * change when the underlying maths changes: https://github.com/ImageMagick/ImageMagick/issues/6924
++ */
++function check_value_posibilities(array $values, $name, array $expected_values)
++{
++ if (array_key_exists($name, $values) !== true) {
++
++ $message = "Expected key '$name' not set. Array contains:\n";
++ $message .= var_export($values, true);
++
++ throw new \Exception($message);
++ }
++
++
++ $value = $values[$name];
++
++ $epsilon = 0.01;
++
++ foreach ($expected_values as $expected_value) {
++ if (($value > $expected_value - $epsilon) && ($value < $expected_value + $epsilon)) {
++ echo "Value for '$name' is $value which is close enough to expected $expected_value\n";
++ return;
++ }
++ }
++
++ $expected_string = implode(", ", $expected_values);
++
++ $message = "Value for $name doesn't match expected possibilities. Expected one of: $expected_string, actual: $value";
++ throw new \Exception($message);
++}
++
++
+ function check_value_with_epsilon(array $values, $name, $expected_value, $epsilon)
+ {
+ if (array_key_exists($name, $values) !== true) {
diff --git a/php-pecl-imagick.spec b/php-pecl-imagick.spec
index e0773cf..8302f5d 100644
--- a/php-pecl-imagick.spec
+++ b/php-pecl-imagick.spec
@@ -1,6 +1,6 @@
# remirepo spec file for php-pecl-imagick
#
-# Copyright (c) 2008-2023 Remi Collet
+# Copyright (c) 2008-2024 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -64,12 +64,14 @@ Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
Release: 0.11.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz
%else
-Release: 9.10%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 10%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
%endif
License: PHP-3.01
URL: https://pecl.php.net/package/imagick
+Patch0: %{pecl_name}-tests.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel
@@ -208,6 +210,8 @@ then : "Font files detected!"
fi
cd %{sources}
+%patch -P0 -p1
+
: Avoid arginfo to be regenerated
rm *.stub.php
@@ -332,8 +336,6 @@ rm tests/244_Tutorial_psychedelicFontGif_basic.phpt
# very long, and erratic results, sometime segfault on shutdown (EL-7/8)
rm tests/073_Imagick_forwardFourierTransformImage_basic.phpt
rm tests/086_Imagick_forwardFourierTransformImage_basic.phpt
-# https://github.com/Imagick/imagick/issues/645
-rm tests/316_Imagick_getImageKurtosis.phpt
: simple module load test for NTS extension
%{__php} --no-php-ini \
@@ -385,6 +387,9 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
%changelog
+* Mon Feb 12 2024 Remi Collet <remi@remirepo.net> - 3.7.0-10
+- add upstream patch for test suite with recent IM versions
+
* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 3.7.0-9
- rebuild for PHP 8.3.0RC1