ext/gd/tests: add SKIPIF stanzas for missing PNG support

The bundled libgd always has PNG support, but an external one may not.
This commit is contained in:
Michael Orlitzky 2023-08-23 19:56:10 -04:00 committed by Gina Peter Banyard
parent 49247de018
commit 0b8466f268
68 changed files with 307 additions and 1 deletions

View File

@ -2,6 +2,12 @@
Bug #22544 (TrueColor transparency in PNG images).
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
$image = imageCreateTruecolor(640, 100);

View File

@ -2,6 +2,12 @@
Bug #22544 (TrueColor transparency in PNG images).
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
$image = imageCreateTruecolor(640, 100);

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if (!function_exists("imagerotate")) die("skip requires imagerotate function");
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -2,6 +2,12 @@
Bug #27582 (ImageFillToBorder() on alphablending image looses alpha on fill color)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
$dest = dirname(realpath(__FILE__)) . '/bug27582.png';

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if (GD_BUNDLED) die("skip requires extern GD\n");
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if(!function_exists('imagettftext')) die('skip imagettftext() not available');
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -7,6 +7,9 @@ gd
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
die("skip test requires GD 2.2.2 or higher");
}
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -7,6 +7,9 @@ gd
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
die("skip test requires GD 2.2.2 or higher");
}
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -2,6 +2,12 @@
Bug #45799 (imagepng() crashes on empty image).
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
$img = imagecreate(500,500);

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream fix not yet released');
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -6,6 +6,9 @@ gd
<?php
if(!function_exists('imagefttext')) die('skip imagefttext() not available');
if (substr(PHP_OS, 0, 3) == 'WIN') die('skip UTF-8 font file names not yet supported on Windows');
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -2,9 +2,13 @@
Bug #48732 (TTF Bounding box wrong for letters below baseline)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if(!function_exists('imagefttext')) die('skip imagefttext() not available');
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,7 +5,9 @@ gd
--SKIPIF--
<?php
if (!function_exists('imagettftext')) die('skip imagettftext() not available');
//die('skip freetype issues');
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -7,6 +7,9 @@ gd
if (!GD_BUNDLED && version_compare(GD_VERSION, "2.3.0") < 0) {
die("skip test requires GD 2.3.0 or higher");
}
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -2,6 +2,12 @@
Bug #52070 (imagedashedline() - dashed line sometimes is not visible)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
$im = imagecreate(1200, 800);

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -7,6 +7,9 @@ gd
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
die("skip test requires GD 2.2.2 or higher");
}
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -2,6 +2,12 @@
Bug #66005 (imagecopy does not support 1bit transparency on truecolor images)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
$dest = imagecreatetruecolor(150, 50);

View File

@ -2,6 +2,12 @@
Bug 72482 (Ilegal write/read access caused by gdImageAALine overflow)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';

View File

@ -2,6 +2,12 @@
Bug #72604 (imagearc() ignores thickness for full arcs)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
$im = imagecreatetruecolor(100, 100);

View File

@ -2,6 +2,12 @@
Bug #72913 (imagecopy() loses single-color transparency on palette images)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
$base64 = 'iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAABnRSTlMAAAAAAABu'

View File

@ -2,6 +2,12 @@
Bug #73213 (Integer overflow in imageline() with antialiasing)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';

View File

@ -2,6 +2,12 @@
Bug #73272 (imagescale() is not affected by, but affects imagesetinterpolation())
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';

View File

@ -2,6 +2,12 @@
Bug #73549 (Use after free when stream is passed to imagepng)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
$stream = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'bug73549.png', 'w');

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream bugfix not yet released');
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -2,6 +2,12 @@
(Bug #74031) ReflectionFunction for imagepng returns wrong number of parameters
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -7,6 +7,9 @@ gd
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<')) {
die('skip only for bundled libgd or external libgd >= 2.2.5');
}
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -2,6 +2,12 @@
Bug #77943 (imageantialias($image, false); does not work)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
require_once __DIR__ . '/func.inc';

View File

@ -4,6 +4,9 @@ Bug #79945 (using php wrappers in imagecreatefrompng causes segmentation fault)
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
set_error_handler(function($errno, $errstr) {
if (str_contains($errstr, 'Cannot cast a filtered stream on this system')) {
die('skip: fopencookie not support on this system');

View File

@ -5,6 +5,12 @@ Edgar Ferreira da Silva <contato [at] edgarfs [dot] com [dot] br>
#testfest PHPSP on 2009-06-20
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,12 @@ Edgar Ferreira da Silva <contato [at] edgarfs [dot] com [dot] br>
#testfest PHPSP on 2009-06-20
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,12 @@ Edgar Ferreira da Silva <contato [at] edgarfs [dot] com [dot] br>
#testfest PHPSP on 2009-06-20
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,12 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);

View File

@ -5,6 +5,12 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);

View File

@ -9,6 +9,9 @@ gd
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
die("skip test requires GD 2.2.2 or higher");
}
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,12 @@ Erick Belluci Tedeschi <erickbt86 [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
// Create a 300x100 image

View File

@ -5,6 +5,12 @@ Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
#testfest PHPSP on 2009-06-20
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);

View File

@ -2,6 +2,12 @@
imagecopyresampled()
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_BMP)) die('skip BMP support required');
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_BMP)) die('skip BMP support required');
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_TGA)) die('skip TGA support required');
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_TGA)) die('skip TGA support required');
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -7,6 +7,9 @@ gd
--SKIPIF--
<?php
if (!function_exists("imagecreatetruecolor")) die("skip GD Version not compatible");
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if (!function_exists('imagecrop')) die( 'skip GD imagecropauto not present; skipping test' );
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if (!function_exists('imagedashedline')) die('skip imagedashedline() not available');
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,12 @@ Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-20
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -10,6 +10,9 @@ gd
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
die("skip test requires GD 2.2.2 or higher");
}
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -10,6 +10,9 @@ gd
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
die("skip test requires GD 2.2.2 or higher");
}
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -10,6 +10,9 @@ gd
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
die("skip test requires GD 2.2.2 or higher");
}
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -2,6 +2,12 @@
Testing imagefilledellipse() of GD library
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if (!function_exists('imagefilledpolygon')) die('skip imagefilledpolygon() not available');
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,12 @@ Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
// Create a image

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if (!function_exists("imagefilter")) die("skip requires imagefilter function");
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -10,6 +10,9 @@ gd
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
die("skip test requires GD 2.2.2 or higher");
}
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -10,6 +10,9 @@ gd
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
die("skip test requires GD 2.2.2 or higher");
}
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -2,6 +2,12 @@
Apply imagegammacorrect() to a step wedge
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
require __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';

View File

@ -2,6 +2,12 @@
imageopenpolygon(): basic test
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';

View File

@ -2,6 +2,12 @@
antialiased imagepolygon()
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if (!function_exists('imagepolygon')) die('skip imagepolygon() not available');
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,12 @@ Ivan Rosolen <contato [at] ivanrosolen [dot] com>
#testfest PHPSP on 2009-06-30
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
// Create a image

View File

@ -2,6 +2,12 @@
Set and get image resolution of PNG images
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'imageresolution_png.png';

View File

@ -5,6 +5,12 @@ Erick Belluci Tedeschi <erickbt86 [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
// Create the brush image

View File

@ -7,6 +7,9 @@ gd
--SKIPIF--
<?php
if (!function_exists("imagecreatetruecolor")) die("skip GD Version not compatible");
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,12 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);

View File

@ -5,6 +5,12 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);

View File

@ -10,6 +10,9 @@ gd
die("skip test requires GD 2.2.2 or higher");
}
if (!function_exists("imagecreatetruecolor")) die("skip GD Version not compatible");
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -5,6 +5,9 @@ gd
--SKIPIF--
<?php
if (GD_BUNDLED) die("skip requires external GD library\n");
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php

View File

@ -2,6 +2,12 @@
test_image_equals_file(): comparing palette images
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';