Skip to content

Skip PNG tests if the system libgd is missing PNG support #13040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ext/gd/tests/bug22544-mb.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/bug22544.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion ext/gd/tests/bug24155.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Bug #24155 (gdImageRotate270 rotation problem).
gd
--SKIPIF--
<?php
if (!function_exists("imagerotate")) die("skip requires bundled GD library\n");
if (!(imagetypes() & IMG_PNG)) {
die("skip No PNG support");
}
?>
--FILE--
<?php
Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/bug27582_1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 0 additions & 4 deletions ext/gd/tests/bug39366.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
Bug #39366 (imagerotate does not respect alpha with angles>45)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!function_exists("imagerotate")) die("skip requires bundled GD library\n");
?>
--FILE--
<?php

Expand Down
3 changes: 3 additions & 0 deletions ext/gd/tests/bug39780_extern.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions ext/gd/tests/bug43073.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions ext/gd/tests/bug43475.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions ext/gd/tests/bug43828.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/bug45799.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions ext/gd/tests/bug47946.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions ext/gd/tests/bug48732-mb.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions ext/gd/tests/bug48732.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion ext/gd/tests/bug50194.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions ext/gd/tests/bug51498.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/bug52070.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions ext/gd/tests/bug53504.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions ext/gd/tests/bug64641.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/bug66005.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/bug72482_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/bug72604.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/bug72913.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/bug73213.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/bug73272.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/bug73549.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
3 changes: 3 additions & 0 deletions ext/gd/tests/bug73614.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/bug74031.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions ext/gd/tests/bug75124.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/bug77943.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
3 changes: 3 additions & 0 deletions ext/gd/tests/bug79945.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/imagearc_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/imagearc_variation1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions ext/gd/tests/imagearc_variation2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading