From 065b4ec1255affac290473f8980a24092f4e3324 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 23 Aug 2023 18:42:17 -0400 Subject: [PATCH] ext/gd/tests: backport optional PNG support - 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. - add SKIPIF stanzas for missing PNG support The bundled libgd always has PNG support, but an external one may not. - imagerotate() is always available Following 59ec80c5, the imagerotate() function is always available. We may therefore remove its function_exists() checks without harm. close GH-17894 --- ext/gd/tests/bug22544-mb.phpt | 6 ++++++ ext/gd/tests/bug22544.phpt | 6 ++++++ ext/gd/tests/bug24155.phpt | 4 +++- ext/gd/tests/bug27582_1.phpt | 6 ++++++ ext/gd/tests/bug39366.phpt | 4 ---- 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 | 5 ++++- 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/imagerotate_overflow.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 ++++++ 70 files changed, 308 insertions(+), 13 deletions(-) diff --git a/ext/gd/tests/bug22544-mb.phpt b/ext/gd/tests/bug22544-mb.phpt index b67478e558c..f99307df121 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-- 45) --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-- = 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-- --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--