Skip to content

Commit 065b4ec

Browse files
orlitzkydevnexen
authored andcommitted
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 59ec80c, the imagerotate() function is always available. We may therefore remove its function_exists() checks without harm. close GH-17894
1 parent 353f214 commit 065b4ec

File tree

70 files changed

+308
-13
lines changed

Some content is hidden

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

70 files changed

+308
-13
lines changed

ext/gd/tests/bug22544-mb.phpt

Lines changed: 6 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ Bug #24155 (gdImageRotate270 rotation problem).
44
gd
55
--SKIPIF--
66
<?php
7-
if (!function_exists("imagerotate")) die("skip requires bundled GD library\n");
7+
if (!(imagetypes() & IMG_PNG)) {
8+
die("skip No PNG support");
9+
}
810
?>
911
--FILE--
1012
<?php

ext/gd/tests/bug27582_1.phpt

Lines changed: 6 additions & 0 deletions
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/bug39366.phpt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
Bug #39366 (imagerotate does not respect alpha with angles>45)
33
--EXTENSIONS--
44
gd
5-
--SKIPIF--
6-
<?php
7-
if (!function_exists("imagerotate")) die("skip requires bundled GD library\n");
8-
?>
95
--FILE--
106
<?php
117

ext/gd/tests/bug39780_extern.phpt

Lines changed: 3 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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);

0 commit comments

Comments
 (0)