From 8b4f8aa63e55424de6e1ed4885fcc592f6e0cb40 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 19 May 2023 14:58:10 -0400 Subject: [PATCH 1/7] ext/gd/tests/bug39780_extern.phpt: update for external gd-2.3.3. Since there are no CI runs with external gd, I can only assume that this test has fallen out-of-date due to changes in PHP itself. I've tweaked the expected output (only slightly) so that the test passes with both gd-2.3.2 and gd-2.3.3. --- ext/gd/tests/bug39780_extern.phpt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/gd/tests/bug39780_extern.phpt b/ext/gd/tests/bug39780_extern.phpt index 5409103b516dd..2330bd65e57ab 100644 --- a/ext/gd/tests/bug39780_extern.phpt +++ b/ext/gd/tests/bug39780_extern.phpt @@ -13,7 +13,9 @@ $im = imagecreatefrompng(__DIR__ . '/bug39780.png'); var_dump($im); ?> --EXPECTF-- -gd-png: fatal libpng error: Read Error: truncated data -gd-png error: setjmp returns error condition 2 -Warning: imagecreatefrompng(): v%sbug39780.png" is not a valid PNG file in /%s on line %d +Warning: imagecreatefrompng(): gd-png: fatal libpng error: Read Error: truncated data%win %s on line %d + +Warning: imagecreatefrompng(): gd-png error: setjmp returns error condition %d%win %s on line %d + +Warning: imagecreatefrompng(): "%sbug39780.png" is not a valid PNG file in %s on line %d bool(false) From 83a56f28c7bed5f6f81c6632a1f4d4fce2084d18 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 19 May 2023 15:08:25 -0400 Subject: [PATCH 2/7] ext/gd/tests/bug66356.phpt: update expected output for external gd. Newer (external) versions of GD start their error messages with lowercase characters, whereas this test is expecting them in uppercase. A single-character wildcard now supports both formats. --- ext/gd/tests/bug66356.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/gd/tests/bug66356.phpt b/ext/gd/tests/bug66356.phpt index e15308dc1c183..b65fb54f57184 100644 --- a/ext/gd/tests/bug66356.phpt +++ b/ext/gd/tests/bug66356.phpt @@ -38,7 +38,7 @@ Array [height] => 10 ) -Warning: imagecrop(): One parameter to a memory allocation multiplication is negative or zero, failing operation gracefully +Warning: imagecrop(): %cne parameter to a memory allocation multiplication is negative or zero, failing operation gracefully in %s on line %d bool(false) object(GdImage)#2 (0) { @@ -46,6 +46,6 @@ object(GdImage)#2 (0) { object(GdImage)#2 (0) { } -Warning: imagecrop(): Product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully +Warning: imagecrop(): %croduct of memory allocation multiplication would exceed INT_MAX, failing operation gracefully in %s on line %d bool(false) From 880b1a3e477ce15baa6b5df6852ece9b4afa2f46 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 19 May 2023 15:19:58 -0400 Subject: [PATCH 3/7] ext/gd/tests/imagegd_truecolor.phpt: skip with external gd >= 2.3.3. This test uses the imagegd() function, but the "gd" format has been disabled by default in upstream gd-2.3.3. We still get some kind of image data back from the call to imagegd(), but its "signature", "truecolor", and "size" no longer match the expected values. This commit skips the test when an external gd >= 2.3.3 is used. --- ext/gd/tests/imagegd_truecolor.phpt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/gd/tests/imagegd_truecolor.phpt b/ext/gd/tests/imagegd_truecolor.phpt index d207485b5271a..14bb8ce92fa98 100644 --- a/ext/gd/tests/imagegd_truecolor.phpt +++ b/ext/gd/tests/imagegd_truecolor.phpt @@ -2,6 +2,12 @@ imagegd() writes truecolor images without palette conversion --EXTENSIONS-- gd +--SKIPIF-- +=')) { + die("skip test requires GD 2.3.2 or older"); + } +?> --FILE-- Date: Fri, 19 May 2023 15:27:05 -0400 Subject: [PATCH 4/7] ext/gd/tests/createfromwbmp2_extern.phpt: update for external gd-2.3.3. Since there are no CI runs with external gd, I can only assume that this test has fallen out-of-date due to changes in PHP itself. I've tweaked the expected output (only slightly) so that the test passes with both gd-2.3.2 and gd-2.3.3. --- ext/gd/tests/createfromwbmp2_extern.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/gd/tests/createfromwbmp2_extern.phpt b/ext/gd/tests/createfromwbmp2_extern.phpt index e3dfcfc7bbdfc..5cd178cb59e52 100644 --- a/ext/gd/tests/createfromwbmp2_extern.phpt +++ b/ext/gd/tests/createfromwbmp2_extern.phpt @@ -43,6 +43,6 @@ $im = imagecreatefromwbmp($filename); unlink($filename); ?> --EXPECTF-- -gd warning: Product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully +Warning: imagecreatefromwbmp(): %croduct of memory allocation multiplication would exceed INT_MAX, failing operation gracefully%win %s on line %d Warning: imagecreatefromwbmp(): "%s_tmp.wbmp" is not a valid WBMP file in %s on line %d From f8b8d766d0987bfaba5dffedebae0b5d095e0c01 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 19 May 2023 15:29:36 -0400 Subject: [PATCH 5/7] ext/gd/tests/libgd00086_extern.phpt: update for external gd-2.3.3. Since there are no CI runs with external gd, I can only assume that this test has fallen out-of-date due to changes in PHP itself. I've tweaked the expected output (only slightly) so that the test passes with both gd-2.3.2 and gd-2.3.3. --- ext/gd/tests/libgd00086_extern.phpt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/gd/tests/libgd00086_extern.phpt b/ext/gd/tests/libgd00086_extern.phpt index 707b910f8c172..8d2b0b7d8dbe8 100644 --- a/ext/gd/tests/libgd00086_extern.phpt +++ b/ext/gd/tests/libgd00086_extern.phpt @@ -13,8 +13,9 @@ $im = imagecreatefrompng(__DIR__ . '/libgd00086.png'); var_dump($im); ?> --EXPECTF-- -gd-png: fatal libpng error: Read Error: truncated data -gd-png error: setjmp returns error condition 1 +Warning: imagecreatefrompng(): gd-png: fatal libpng error: Read Error: truncated data%win %s on line %d + +Warning: imagecreatefrompng(): gd-png error: setjmp returns error condition %d%win %s on line %d Warning: imagecreatefrompng(): "%slibgd00086.png" is not a valid PNG file in %s on line %d bool(false) From 633639a784cafc4e3d07460ac3d235db11bace41 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 19 May 2023 15:54:08 -0400 Subject: [PATCH 6/7] ext/gd/tests/bug77272.phpt: update expected output for external gd. Newer (external) versions of GD start their error messages with lowercase characters, whereas this test is expecting them in uppercase. A single-character wildcard now supports both formats. --- ext/gd/tests/bug77272.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/gd/tests/bug77272.phpt b/ext/gd/tests/bug77272.phpt index fc5ee464a07bb..f2483f915c17b 100644 --- a/ext/gd/tests/bug77272.phpt +++ b/ext/gd/tests/bug77272.phpt @@ -16,6 +16,6 @@ $img = imagecreate(2**28, 1); var_dump(imagescale($img, 1, 1, IMG_TRIANGLE)); ?> --EXPECTF-- -Warning: imagescale():%S Product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully +Warning: imagescale():%S %croduct of memory allocation multiplication would exceed INT_MAX, failing operation gracefully in %s on line %d bool(false) From 40d32af808ad31b11f7e2b6046e0ab105e03fb13 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 19 May 2023 17:11:01 -0400 Subject: [PATCH 7/7] ext/gd/tests/bug77479.phpt: update for newer external gd. This test fails with gd-2.3.3 (at least) due to minor capitalization and whitespace issues. We add some wildcards to account for the difference. --- ext/gd/tests/bug77479.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/gd/tests/bug77479.phpt b/ext/gd/tests/bug77479.phpt index 332b2210715cc..504ff7abca1c0 100644 --- a/ext/gd/tests/bug77479.phpt +++ b/ext/gd/tests/bug77479.phpt @@ -15,10 +15,10 @@ imagecolorallocate($im, 0, 0, 0); imagewbmp($im, __DIR__ . '/77479.wbmp'); ?> --EXPECTF-- -Warning: imagewbmp():%S Product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully +Warning: imagewbmp():%S %croduct of memory allocation multiplication would exceed INT_MAX, failing operation gracefully in %s on line %d -Warning: imagewbmp(): Could not create WBMP in %s on line %d +Warning: imagewbmp(): Could not create WBMP%win %s on line %d --CLEAN--