Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 4 additions & 1 deletion ext/gd/tests/bug24155.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ Bug #24155 (gdImageRotate270 rotation problem).
gd
--SKIPIF--
<?php
if (!function_exists("imagerotate")) die("skip requires bundled GD library\n");
if (!function_exists("imagerotate")) die("skip requires imagerotate function");
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
2 changes: 1 addition & 1 deletion ext/gd/tests/bug39366.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Bug #39366 (imagerotate does not respect alpha with angles>45)
gd
--SKIPIF--
<?php
if (!function_exists("imagerotate")) die("skip requires bundled GD library\n");
if (!function_exists("imagerotate")) die("skip requires imagerotate function");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it just require this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, obviously not. But instead of adding more checks, maybe we need fewer. Can this fail at all?

My inspiration for skip requires imagerotate function was a combination of the test description and some other tests that do the same thing. But I think these may all date back to a time when the bundled libgd had gdImageRotateInterpolated() but the external libgd might not have. These days both should have it (it's ten years old, and not guarded by an #ifdef), so the function_exists() check is probably pointless. None of the other image* functions are #ifdefed either.

I can remove the check if you think that's best.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing them is probably best then yes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easy enough. I tracked down the exact commit where the #ifdef was removed for imagerotate(), it was even older than I thought.

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