From e25636b087c507bf12922c8faf9f526aa87153a6 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 23 Aug 2023 18:42:17 -0400 Subject: [PATCH 1/3] ext/gd/tests: fix three misleading die() messages Three of our gd tests could be skipped with a message about requiring bundled GD, but those tests don't actually require bundled GD. We update the messages to mention the specific functions that are required. --- ext/gd/tests/bug24155.phpt | 2 +- ext/gd/tests/bug39366.phpt | 2 +- ext/gd/tests/imagefilter.phpt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/gd/tests/bug24155.phpt b/ext/gd/tests/bug24155.phpt index 42c5e3d7926f5..7c12c38a1a6d7 100644 --- a/ext/gd/tests/bug24155.phpt +++ b/ext/gd/tests/bug24155.phpt @@ -4,7 +4,7 @@ Bug #24155 (gdImageRotate270 rotation problem). gd --SKIPIF-- --FILE-- 45) gd --SKIPIF-- --FILE-- --FILE-- Date: Wed, 23 Aug 2023 19:56:10 -0400 Subject: [PATCH 2/3] ext/gd/tests: add SKIPIF stanzas for missing PNG support The bundled libgd always has PNG support, but an external one may not. --- ext/gd/tests/bug22544-mb.phpt | 6 ++++++ ext/gd/tests/bug22544.phpt | 6 ++++++ ext/gd/tests/bug24155.phpt | 3 +++ ext/gd/tests/bug27582_1.phpt | 6 ++++++ ext/gd/tests/bug39780_extern.phpt | 3 +++ ext/gd/tests/bug43073.phpt | 3 +++ ext/gd/tests/bug43475.phpt | 3 +++ ext/gd/tests/bug43828.phpt | 3 +++ ext/gd/tests/bug45799.phpt | 6 ++++++ ext/gd/tests/bug47946.phpt | 3 +++ ext/gd/tests/bug48732-mb.phpt | 3 +++ ext/gd/tests/bug48732.phpt | 4 ++++ ext/gd/tests/bug50194.phpt | 4 +++- ext/gd/tests/bug51498.phpt | 3 +++ ext/gd/tests/bug52070.phpt | 6 ++++++ ext/gd/tests/bug53504.phpt | 3 +++ ext/gd/tests/bug64641.phpt | 3 +++ ext/gd/tests/bug66005.phpt | 6 ++++++ ext/gd/tests/bug72482_2.phpt | 6 ++++++ ext/gd/tests/bug72604.phpt | 6 ++++++ ext/gd/tests/bug72913.phpt | 6 ++++++ ext/gd/tests/bug73213.phpt | 6 ++++++ ext/gd/tests/bug73272.phpt | 6 ++++++ ext/gd/tests/bug73549.phpt | 6 ++++++ ext/gd/tests/bug73614.phpt | 3 +++ ext/gd/tests/bug74031.phpt | 6 ++++++ ext/gd/tests/bug75124.phpt | 3 +++ ext/gd/tests/bug77943.phpt | 6 ++++++ ext/gd/tests/bug79945.phpt | 3 +++ ext/gd/tests/imagearc_basic.phpt | 6 ++++++ ext/gd/tests/imagearc_variation1.phpt | 6 ++++++ ext/gd/tests/imagearc_variation2.phpt | 6 ++++++ ext/gd/tests/imagechar_basic.phpt | 6 ++++++ ext/gd/tests/imagecharup_basic.phpt | 6 ++++++ ext/gd/tests/imagecolorallocatealpha_basic.phpt | 3 +++ ext/gd/tests/imagecolorset_basic.phpt | 6 ++++++ ext/gd/tests/imageconvolution_basic.phpt | 6 ++++++ ext/gd/tests/imagecopyresampled_basic.phpt | 6 ++++++ ext/gd/tests/imagecreatefrombmp_basic.phpt | 3 +++ ext/gd/tests/imagecreatefromstring_bmp.phpt | 3 +++ ext/gd/tests/imagecreatefromtga_basic.phpt | 3 +++ ext/gd/tests/imagecreatefromtga_variation.phpt | 3 +++ ext/gd/tests/imagecreatetruecolor_basic.phpt | 3 +++ ext/gd/tests/imagecrop_auto.phpt | 3 +++ ext/gd/tests/imagedashedline_basic.phpt | 3 +++ ext/gd/tests/imageellipse_basic.phpt | 6 ++++++ ext/gd/tests/imagefilledarc_basic.phpt | 3 +++ ext/gd/tests/imagefilledarc_variation1.phpt | 3 +++ ext/gd/tests/imagefilledarc_variation2.phpt | 3 +++ ext/gd/tests/imagefilledellipse_basic.phpt | 6 ++++++ ext/gd/tests/imagefilledpolygon_basic.phpt | 3 +++ ext/gd/tests/imagefilltoborder_basic.phpt | 6 ++++++ ext/gd/tests/imagefilter.phpt | 3 +++ ext/gd/tests/imagegammacorrect_basic.phpt | 3 +++ ext/gd/tests/imagegammacorrect_variation1.phpt | 3 +++ ext/gd/tests/imagegammacorrect_variation2.phpt | 6 ++++++ ext/gd/tests/imageopenpolygon_basic.phpt | 6 ++++++ ext/gd/tests/imagepolygon_aa.phpt | 6 ++++++ ext/gd/tests/imagepolygon_basic.phpt | 3 +++ ext/gd/tests/imagerectangle_basic.phpt | 6 ++++++ ext/gd/tests/imageresolution_png.phpt | 6 ++++++ ext/gd/tests/imagesetbrush_basic.phpt | 6 ++++++ ext/gd/tests/imagesetthickness_basic.phpt | 3 +++ ext/gd/tests/imagestring_basic.phpt | 6 ++++++ ext/gd/tests/imagestringup_basic.phpt | 6 ++++++ ext/gd/tests/imagetruecolortopalette_basic.phpt | 3 +++ ext/gd/tests/libgd00086_extern.phpt | 3 +++ ext/gd/tests/test_image_equals_file_palette.phpt | 6 ++++++ 68 files changed, 307 insertions(+), 1 deletion(-) diff --git a/ext/gd/tests/bug22544-mb.phpt b/ext/gd/tests/bug22544-mb.phpt index b67478e558c47..f99307df1212b 100644 --- a/ext/gd/tests/bug22544-mb.phpt +++ b/ext/gd/tests/bug22544-mb.phpt @@ -2,6 +2,12 @@ Bug #22544 (TrueColor transparency in PNG images). --EXTENSIONS-- gd +--SKIPIF-- + --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- = 2.2.5'); } +if (!(imagetypes() & IMG_PNG)) { + die("skip No PNG support"); +} ?> --FILE-- --FILE-- #testfest PHPSP on 2009-06-20 --EXTENSIONS-- gd +--SKIPIF-- + --FILE-- #testfest PHPSP on 2009-06-20 --EXTENSIONS-- gd +--SKIPIF-- + --FILE-- #testfest PHPSP on 2009-06-20 --EXTENSIONS-- gd +--SKIPIF-- + --FILE-- #testfest PHPSP on 2009-06-20 --EXTENSIONS-- gd +--SKIPIF-- + --FILE-- #testfest PHPSP on 2009-06-20 --EXTENSIONS-- gd +--SKIPIF-- + --FILE-- --FILE-- #testfest PHPSP on 2009-06-20 --EXTENSIONS-- gd +--SKIPIF-- + --FILE-- #testfest PHPSP on 2009-06-20 --EXTENSIONS-- gd +--SKIPIF-- + --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- #testfest PHPSP on 2009-06-20 --EXTENSIONS-- gd +--SKIPIF-- + --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- #testfest PHPSP on 2009-06-30 --EXTENSIONS-- gd +--SKIPIF-- + --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- #testfest PHPSP on 2009-06-30 --EXTENSIONS-- gd +--SKIPIF-- + --FILE-- --FILE-- #testfest PHPSP on 2009-06-20 --EXTENSIONS-- gd +--SKIPIF-- + --FILE-- --FILE-- #testfest PHPSP on 2009-06-20 --EXTENSIONS-- gd +--SKIPIF-- + --FILE-- #testfest PHPSP on 2009-06-20 --EXTENSIONS-- gd +--SKIPIF-- + --FILE-- --FILE-- --FILE-- --FILE-- Date: Sat, 30 Dec 2023 16:13:40 -0500 Subject: [PATCH 3/3] ext/gd/tests: imagerotate() is always available Following 59ec80c5, the imagerotate() function is always available. We may therefore remove its function_exists() checks without harm. --- ext/gd/tests/bug24155.phpt | 1 - ext/gd/tests/bug39366.phpt | 4 ---- ext/gd/tests/imagerotate_overflow.phpt | 6 ------ 3 files changed, 11 deletions(-) diff --git a/ext/gd/tests/bug24155.phpt b/ext/gd/tests/bug24155.phpt index d78ee9b77816f..c93c3bbbcb586 100644 --- a/ext/gd/tests/bug24155.phpt +++ b/ext/gd/tests/bug24155.phpt @@ -4,7 +4,6 @@ Bug #24155 (gdImageRotate270 rotation problem). gd --SKIPIF-- 45) --EXTENSIONS-- gd ---SKIPIF-- - --FILE-- --FILE-- Date: Wed, 10 Jul 2024 08:20:31 -0400 Subject: [PATCH 1/1] ext/gd/tests/gh10614.phpt: skip if no PNG support This test uses imagecreatefrompng(), which won't be there if libgd was built without PNG support. --- ext/gd/tests/gh10614.phpt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/gd/tests/gh10614.phpt b/ext/gd/tests/gh10614.phpt index c068914183..1b91115d74 100644 --- a/ext/gd/tests/gh10614.phpt +++ b/ext/gd/tests/gh10614.phpt @@ -5,6 +5,9 @@ --SKIPIF-- =')) die("skip test requires GD 2.3.4 or older"); +if (!(imagetypes() & IMG_PNG)) { + die("skip No PNG support"); +} ?> --FILE--