Skip to content

Commit 0b8466f

Browse files
orlitzkyGirgias
authored andcommitted
ext/gd/tests: add SKIPIF stanzas for missing PNG support
The bundled libgd always has PNG support, but an external one may not.
1 parent 49247de commit 0b8466f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+307
-1
lines changed

ext/gd/tests/bug22544-mb.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Bug #22544 (TrueColor transparency in PNG images).
33
--EXTENSIONS--
44
gd
5+
--SKIPIF--
6+
<?php
7+
if (!(imagetypes() & IMG_PNG)) {
8+
die("skip No PNG support");
9+
}
10+
?>
511
--FILE--
612
<?php
713
$image = imageCreateTruecolor(640, 100);

ext/gd/tests/bug22544.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Bug #22544 (TrueColor transparency in PNG images).
33
--EXTENSIONS--
44
gd
5+
--SKIPIF--
6+
<?php
7+
if (!(imagetypes() & IMG_PNG)) {
8+
die("skip No PNG support");
9+
}
10+
?>
511
--FILE--
612
<?php
713
$image = imageCreateTruecolor(640, 100);

ext/gd/tests/bug24155.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ gd
55
--SKIPIF--
66
<?php
77
if (!function_exists("imagerotate")) die("skip requires imagerotate function");
8+
if (!(imagetypes() & IMG_PNG)) {
9+
die("skip No PNG support");
10+
}
811
?>
912
--FILE--
1013
<?php

ext/gd/tests/bug27582_1.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Bug #27582 (ImageFillToBorder() on alphablending image looses alpha on fill color)
33
--EXTENSIONS--
44
gd
5+
--SKIPIF--
6+
<?php
7+
if (!(imagetypes() & IMG_PNG)) {
8+
die("skip No PNG support");
9+
}
10+
?>
511
--FILE--
612
<?php
713
$dest = dirname(realpath(__FILE__)) . '/bug27582.png';

ext/gd/tests/bug39780_extern.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ gd
55
--SKIPIF--
66
<?php
77
if (GD_BUNDLED) die("skip requires extern GD\n");
8+
if (!(imagetypes() & IMG_PNG)) {
9+
die("skip No PNG support");
10+
}
811
?>
912
--FILE--
1013
<?php

ext/gd/tests/bug43073.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ gd
55
--SKIPIF--
66
<?php
77
if(!function_exists('imagettftext')) die('skip imagettftext() not available');
8+
if (!(imagetypes() & IMG_PNG)) {
9+
die("skip No PNG support");
10+
}
811
?>
912
--FILE--
1013
<?php

ext/gd/tests/bug43475.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ gd
77
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
88
die("skip test requires GD 2.2.2 or higher");
99
}
10+
if (!(imagetypes() & IMG_PNG)) {
11+
die("skip No PNG support");
12+
}
1013
?>
1114
--FILE--
1215
<?php

ext/gd/tests/bug43828.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ gd
77
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
88
die("skip test requires GD 2.2.2 or higher");
99
}
10+
if (!(imagetypes() & IMG_PNG)) {
11+
die("skip No PNG support");
12+
}
1013
?>
1114
--FILE--
1215
<?php

ext/gd/tests/bug45799.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Bug #45799 (imagepng() crashes on empty image).
33
--EXTENSIONS--
44
gd
5+
--SKIPIF--
6+
<?php
7+
if (!(imagetypes() & IMG_PNG)) {
8+
die("skip No PNG support");
9+
}
10+
?>
511
--FILE--
612
<?php
713
$img = imagecreate(500,500);

ext/gd/tests/bug47946.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ gd
55
--SKIPIF--
66
<?php
77
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream fix not yet released');
8+
if (!(imagetypes() & IMG_PNG)) {
9+
die("skip No PNG support");
10+
}
811
?>
912
--FILE--
1013
<?php

ext/gd/tests/bug48732-mb.phpt

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

ext/gd/tests/bug48732.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
Bug #48732 (TTF Bounding box wrong for letters below baseline)
33
--EXTENSIONS--
44
gd
5+
56
--SKIPIF--
67
<?php
78
if(!function_exists('imagefttext')) die('skip imagefttext() not available');
9+
if (!(imagetypes() & IMG_PNG)) {
10+
die("skip No PNG support");
11+
}
812
?>
913
--FILE--
1014
<?php

ext/gd/tests/bug50194.phpt

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ gd
55
--SKIPIF--
66
<?php
77
if (!function_exists('imagettftext')) die('skip imagettftext() not available');
8-
//die('skip freetype issues');
8+
if (!(imagetypes() & IMG_PNG)) {
9+
die("skip No PNG support");
10+
}
911
?>
1012
--FILE--
1113
<?php

ext/gd/tests/bug51498.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ gd
77
if (!GD_BUNDLED && version_compare(GD_VERSION, "2.3.0") < 0) {
88
die("skip test requires GD 2.3.0 or higher");
99
}
10+
if (!(imagetypes() & IMG_PNG)) {
11+
die("skip No PNG support");
12+
}
1013
?>
1114
--FILE--
1215
<?php

ext/gd/tests/bug52070.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Bug #52070 (imagedashedline() - dashed line sometimes is not visible)
33
--EXTENSIONS--
44
gd
5+
--SKIPIF--
6+
<?php
7+
if (!(imagetypes() & IMG_PNG)) {
8+
die("skip No PNG support");
9+
}
10+
?>
511
--FILE--
612
<?php
713
$im = imagecreate(1200, 800);

ext/gd/tests/bug53504.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ gd
55
--SKIPIF--
66
<?php
77
if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
8+
if (!(imagetypes() & IMG_PNG)) {
9+
die("skip No PNG support");
10+
}
811
?>
912
--FILE--
1013
<?php

ext/gd/tests/bug64641.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ gd
77
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
88
die("skip test requires GD 2.2.2 or higher");
99
}
10+
if (!(imagetypes() & IMG_PNG)) {
11+
die("skip No PNG support");
12+
}
1013
?>
1114
--FILE--
1215
<?php

ext/gd/tests/bug66005.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Bug #66005 (imagecopy does not support 1bit transparency on truecolor images)
33
--EXTENSIONS--
44
gd
5+
--SKIPIF--
6+
<?php
7+
if (!(imagetypes() & IMG_PNG)) {
8+
die("skip No PNG support");
9+
}
10+
?>
511
--FILE--
612
<?php
713
$dest = imagecreatetruecolor(150, 50);

ext/gd/tests/bug72482_2.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Bug 72482 (Ilegal write/read access caused by gdImageAALine overflow)
33
--EXTENSIONS--
44
gd
5+
--SKIPIF--
6+
<?php
7+
if (!(imagetypes() & IMG_PNG)) {
8+
die("skip No PNG support");
9+
}
10+
?>
511
--FILE--
612
<?php
713
require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';

ext/gd/tests/bug72604.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Bug #72604 (imagearc() ignores thickness for full arcs)
33
--EXTENSIONS--
44
gd
5+
--SKIPIF--
6+
<?php
7+
if (!(imagetypes() & IMG_PNG)) {
8+
die("skip No PNG support");
9+
}
10+
?>
511
--FILE--
612
<?php
713
$im = imagecreatetruecolor(100, 100);

ext/gd/tests/bug72913.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Bug #72913 (imagecopy() loses single-color transparency on palette images)
33
--EXTENSIONS--
44
gd
5+
--SKIPIF--
6+
<?php
7+
if (!(imagetypes() & IMG_PNG)) {
8+
die("skip No PNG support");
9+
}
10+
?>
511
--FILE--
612
<?php
713
$base64 = 'iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAABnRSTlMAAAAAAABu'

ext/gd/tests/bug73213.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Bug #73213 (Integer overflow in imageline() with antialiasing)
33
--EXTENSIONS--
44
gd
5+
--SKIPIF--
6+
<?php
7+
if (!(imagetypes() & IMG_PNG)) {
8+
die("skip No PNG support");
9+
}
10+
?>
511
--FILE--
612
<?php
713
require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';

ext/gd/tests/bug73272.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Bug #73272 (imagescale() is not affected by, but affects imagesetinterpolation())
33
--EXTENSIONS--
44
gd
5+
--SKIPIF--
6+
<?php
7+
if (!(imagetypes() & IMG_PNG)) {
8+
die("skip No PNG support");
9+
}
10+
?>
511
--FILE--
612
<?php
713
require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';

ext/gd/tests/bug73549.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Bug #73549 (Use after free when stream is passed to imagepng)
33
--EXTENSIONS--
44
gd
5+
--SKIPIF--
6+
<?php
7+
if (!(imagetypes() & IMG_PNG)) {
8+
die("skip No PNG support");
9+
}
10+
?>
511
--FILE--
612
<?php
713
$stream = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'bug73549.png', 'w');

ext/gd/tests/bug73614.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ gd
55
--SKIPIF--
66
<?php
77
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream bugfix not yet released');
8+
if (!(imagetypes() & IMG_PNG)) {
9+
die("skip No PNG support");
10+
}
811
?>
912
--FILE--
1013
<?php

ext/gd/tests/bug74031.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
(Bug #74031) ReflectionFunction for imagepng returns wrong number of parameters
33
--EXTENSIONS--
44
gd
5+
--SKIPIF--
6+
<?php
7+
if (!(imagetypes() & IMG_PNG)) {
8+
die("skip No PNG support");
9+
}
10+
?>
511
--FILE--
612
<?php
713

ext/gd/tests/bug75124.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ gd
77
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<')) {
88
die('skip only for bundled libgd or external libgd >= 2.2.5');
99
}
10+
if (!(imagetypes() & IMG_PNG)) {
11+
die("skip No PNG support");
12+
}
1013
?>
1114
--FILE--
1215
<?php

ext/gd/tests/bug77943.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Bug #77943 (imageantialias($image, false); does not work)
33
--EXTENSIONS--
44
gd
5+
--SKIPIF--
6+
<?php
7+
if (!(imagetypes() & IMG_PNG)) {
8+
die("skip No PNG support");
9+
}
10+
?>
511
--FILE--
612
<?php
713
require_once __DIR__ . '/func.inc';

ext/gd/tests/bug79945.phpt

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

ext/gd/tests/imagearc_basic.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Edgar Ferreira da Silva <contato [at] edgarfs [dot] com [dot] br>
55
#testfest PHPSP on 2009-06-20
66
--EXTENSIONS--
77
gd
8+
--SKIPIF--
9+
<?php
10+
if (!(imagetypes() & IMG_PNG)) {
11+
die("skip No PNG support");
12+
}
13+
?>
814
--FILE--
915
<?php
1016

ext/gd/tests/imagearc_variation1.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Edgar Ferreira da Silva <contato [at] edgarfs [dot] com [dot] br>
55
#testfest PHPSP on 2009-06-20
66
--EXTENSIONS--
77
gd
8+
--SKIPIF--
9+
<?php
10+
if (!(imagetypes() & IMG_PNG)) {
11+
die("skip No PNG support");
12+
}
13+
?>
814
--FILE--
915
<?php
1016

ext/gd/tests/imagearc_variation2.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Edgar Ferreira da Silva <contato [at] edgarfs [dot] com [dot] br>
55
#testfest PHPSP on 2009-06-20
66
--EXTENSIONS--
77
gd
8+
--SKIPIF--
9+
<?php
10+
if (!(imagetypes() & IMG_PNG)) {
11+
die("skip No PNG support");
12+
}
13+
?>
814
--FILE--
915
<?php
1016

ext/gd/tests/imagechar_basic.phpt

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
55
#testfest PHPSP on 2009-06-20
66
--EXTENSIONS--
77
gd
8+
--SKIPIF--
9+
<?php
10+
if (!(imagetypes() & IMG_PNG)) {
11+
die("skip No PNG support");
12+
}
13+
?>
814
--FILE--
915
<?php
1016
$image = imagecreatetruecolor(180, 30);

0 commit comments

Comments
 (0)