- enable tests even when an external GD is used. Latest releases

(2.0.34 or 2.0.35) work.
  NB: if you use Debian, you'll realize how bad their package is and start
  to either use the source or push all patches I posted to their bugs
  tracker
This commit is contained in:
Pierre Joye 2007-05-28 17:57:20 +00:00
parent 5d6f374641
commit 8e664dd105
35 changed files with 141 additions and 106 deletions

View File

@ -3,7 +3,6 @@ Bug #19366 (gdimagefill() function crashes (fixed in bundled libgd))
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
?>
--FILE--
<?php

View File

@ -5,9 +5,6 @@ Bug #22544 (TrueColor transparency in PNG images).
if (!extension_loaded('gd')) {
die("skip gd extension not available\n");
}
if (!GD_BUNDLED) {
die('skip external GD libraries may fail');
}
?>
--FILE--
<?php

View File

@ -1,13 +1,11 @@
--TEST--
Bug #24155 (gdImageRotate270 rotation problem).
--SKIPIF--
<?php
if (!extension_loaded('gd')) {
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available\n");
}
if (!GD_BUNDLED) {
die('skip external GD libraries may fail');
}
if (!function_exists("imagerotate")) die("skip requires bundled GD library\n");
?>
--FILE--
<?php
@ -15,7 +13,7 @@ Bug #24155 (gdImageRotate270 rotation problem).
@unlink($dest);
$im = imagecreatetruecolor(30, 50);
imagefill($im, 0, 0, (16777215 - 255));
imagefill($im, 0, 0, (16777215 - 255));
$im = imagerotate($im, 270, 255);
imagepng($im, $dest);

View File

@ -5,9 +5,6 @@ Bug #24594 (Filling an area using tiles).
if (!extension_loaded('gd')) {
die("skip gd extension not available\n");
}
if (!GD_BUNDLED) {
die('skip external GD libraries may fail');
}
?>
--FILE--
<?php

View File

@ -3,7 +3,6 @@ Bug #27582 (ImageFillToBorder() on alphablending image looses alpha on fill colo
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
?>
--FILE--
<?php

View File

@ -1,9 +1,9 @@
--TEST--
Bug #28147 (Crash with anti-aliased line)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!function_exists("imageantialias")) die("skip requires bundled GD library\n");
?>
--FILE--
<?php

View File

@ -1,13 +1,10 @@
--TEST--
Bug #36697 (TrueColor transparency with GIF palette output).
--SKIPIF--
<?php
if (!extension_loaded('gd')) {
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available\n");
}
if (!GD_BUNDLED) {
die('skip external GD libraries may fail');
}
?>
--FILE--
<?php

View File

@ -1,9 +1,8 @@
--TEST--
Bug #37346 (gdimagecreatefromgif, bad colormap)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
?>
--FILE--
<?php

View File

@ -1,9 +1,8 @@
--TEST--
Bug #37360 (gdimagecreatefromgif, bad image sizes)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
?>
--FILE--
<?php

View File

@ -1,13 +1,10 @@
--TEST--
Bug #38112 (GIF Invalid Code size ).
--SKIPIF--
<?php
if (!extension_loaded('gd')) {
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available\n");
}
if (!GD_BUNDLED) {
die('skip external GD libraries may fail');
}
?>
--FILE--
<?php

View File

@ -1,13 +1,10 @@
--TEST--
Bug #39082 (Output image to stdout segfaults).
--SKIPIF--
<?php
if (!extension_loaded('gd')) {
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available\n");
}
if (!GD_BUNDLED) {
die('skip external GD libraries may fail');
}
?>
--FILE--
<?php

View File

@ -1,9 +1,8 @@
--TEST--
Bug #37360 (gdimagecreatefromgif, bad image sizes)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
?>
--FILE--
<?php

View File

@ -1,9 +1,8 @@
--TEST--
Bug #39508 (imagefill crashes with small images 3 pixels or less)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
?>
--FILE--
<?php

View File

@ -1,9 +1,9 @@
--TEST--
Bug #39366 (imagerotate does not respect alpha with angles>45)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!function_exists("imagerotate")) die("skip requires bundled GD library\n");
?>
--FILE--
<?php

View File

@ -1,9 +1,8 @@
--TEST--
Bug #39508 (imagefill crashes with small images 3 pixels or less)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
?>
--FILE--
<?php

View File

@ -1,9 +1,9 @@
--TEST--
Bug #39780 (PNG image with CRC/data error raises a fatal error)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die("skip requires bundled GD library\n");
?>
--FILE--
<?php
@ -12,6 +12,7 @@ $im = imagecreatefrompng(dirname(__FILE__) . '/bug39780.png');
var_dump($im);
?>
--EXPECTF--
Warning: imagecreatefrompng(): gd-png: fatal libpng error: Read Error: truncated data in %s on line %d
Warning: imagecreatefrompng(): gd-png error: setjmp returns error condition in %s on line %d

View File

@ -0,0 +1,18 @@
--TEST--
Bug #39780 (PNG image with CRC/data error raises a fatal error)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (GD_BUNDLED) die("skip requires extern GD\n");
?>
--FILE--
<?php
$im = imagecreatefrompng(dirname(__FILE__) . '/bug39780.png');
var_dump($im);
?>
--EXPECTF--
gd-png: fatal libpng error: Read Error: truncated data
gd-png error: setjmp returns error condition 2
Warning: imagecreatefrompng(): '%sbug39780.png' is not a valid PNG file in /%s on line %d
bool(false)

View File

@ -3,7 +3,6 @@ imagecreatefromgd2
--SKIPIF--
<?php
if (!function_exists('imagecreatefromgd2')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
?>
--FILE--
<?php

View File

@ -3,7 +3,6 @@ imagecreatefromwbmp
--SKIPIF--
<?php
if (!function_exists('imagecreatefromwbmp')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
?>
--FILE--
<?php

View File

@ -0,0 +1,47 @@
--TEST--
imagecreatefromwbmp with invalid wbmp
--SKIPIF--
<?php
if (!function_exists('imagecreatefromwbmp')) die("skip gd extension not available\n");
if (GD_BUNDLED) die("skip requires extern GD\n");
?>
--FILE--
<?php
$filename = dirname(__FILE__) . '/_tmp.wbmp';
$fp = fopen($filename,"wb");
if (!$fp) {
exit("Failed to create <$filename>");
}
//write header
$c = 0;
fputs($fp, chr($c), 1);
fputs($fp, $c, 1);
//write width = 2^32 / 4 + 1
$c = 0x84;
fputs($fp, chr($c), 1);
$c = 0x80;
fputs($fp, chr($c), 1);
fputs($fp, chr($c), 1);
fputs($fp, chr($c), 1);
$c = 0x01;
fputs($fp, chr($c), 1);
/*write height = 4*/
$c = 0x04;
fputs($fp, chr($c), 1);
/*write some data to cause overflow*/
for ($i=0; $i<10000; $i++) {
fwrite($fp, chr($c), 1);
}
fclose($fp);
$im = imagecreatefromwbmp($filename);
unlink($filename);
?>
--EXPECTF--
gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
Warning: imagecreatefromwbmp(): '%s_tmp.wbmp' is not a valid WBMP file in %s on line %d

View File

@ -30,7 +30,6 @@ if ($p1 && $p2 && $p3 && $p4 && $p5) {
}
imagedestroy($im);
$im = imagecreatetruecolor(6,6);
imagefill($im, 0,0, 0xffffff);

View File

@ -1,13 +1,11 @@
--TEST--
gif --> gd1/gd2 conversion test
--SKIPIF--
<?php
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available.");
}
if (!GD_BUNDLED) {
die("skip external GD libraries always fail");
}
if (!function_exists("imagecreatefromgif")) {
die("skip gif read support unavailable");
}

View File

@ -1,13 +1,11 @@
--TEST--
gif --> jpeg conversion test
--SKIPIF--
<?php
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available.");
}
if (!GD_BUNDLED) {
die("skip external GD libraries always fail");
}
if (!function_exists("imagejpeg")) {
die("skip jpeg support unavailable");
}

View File

@ -1,13 +1,11 @@
--TEST--
gif --> png conversion test
--SKIPIF--
<?php
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available.");
}
if (!GD_BUNDLED) {
die("skip external GD libraries always fail");
}
if (!function_exists("imagepng")) {
die("skip png support unavailable");
}

View File

@ -1,13 +1,11 @@
--TEST--
imagefilter() function test
--SKIPIF--
<?php
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available.");
}
if (!GD_BUNDLED) {
die("skip this test requires bundled gd library.");
}
if (!function_exists("imagefilter")) die("skip requires bundled GD library\n");
?>
--FILE--
<?php
@ -15,7 +13,7 @@ $no_arg_filters = array(
"IMG_FILTER_NEGATE",
"IMG_FILTER_GRAYSCALE",
"IMG_FILTER_EDGEDETECT",
"IMG_FILTER_GAUSSIAN_BLUR",
"IMG_FILTER_GAUSSIAN_BLUR",
"IMG_FILTER_SELECTIVE_BLUR",
"IMG_FILTER_EMBOSS",
"IMG_FILTER_MEAN_REMOVAL"
@ -33,7 +31,7 @@ $SOURCE_IMG = $SAVE_DIR . "/test.png";
} else {
echo "$filt failed\n";
}
}
}
$im = imagecreatefrompng($SOURCE_IMG);

View File

@ -3,7 +3,6 @@ imagewbmp
--SKIPIF--
<?php
if (!function_exists('imagecreatefromwbmp')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
?>
--FILE--
<?php

View File

@ -1,13 +1,11 @@
--TEST--
jpeg <--> png conversion test
--SKIPIF--
<?php
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available.");
}
if (!GD_BUNDLED) {
die("skip external GD libraries always fail");
}
if (!function_exists("imagecreatefrompng") || !function_exists("imagepng")) {
die("skip png support unavailable");
}

View File

@ -1,13 +1,11 @@
--TEST--
jpeg <--> gd1/gd2 conversion test
--SKIPIF--
<?php
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available.");
}
if (!GD_BUNDLED) {
die("skip external GD libraries always fail");
}
if (!function_exists("imagecreatefromjpeg") || !function_exists("imagejpeg")) {
die("skip jpeg support unavailable");
}

View File

@ -1,9 +1,9 @@
--TEST--
libgd #86 (Possible infinite loop in imagecreatefrompng)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die("skip requires bundled GD library\n");
?>
--FILE--
<?php

View File

@ -0,0 +1,19 @@
--TEST--
libgd #86 (Possible infinite loop in imagecreatefrompng)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (GD_BUNDLED) die("skip requires external GD library\n");
?>
--FILE--
<?php
$im = imagecreatefrompng(dirname(__FILE__) . '/libgd00086.png');
var_dump($im);
?>
--EXPECTF--
gd-png: fatal libpng error: Read Error: truncated data
gd-png error: setjmp returns error condition 1
Warning: imagecreatefrompng(): '%slibgd00086.png' is not a valid PNG file in %s on line %d
bool(false)

View File

@ -1,13 +1,11 @@
--TEST--
png <--> gd1/gd2 conversion test
--SKIPIF--
<?php
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available.");
}
if (!GD_BUNDLED) {
die("skip external GD libraries always fail");
}
if (!function_exists("imagecreatefrompng") || !function_exists("imagepng")) {
die("skip png support unavailable");
}

View File

@ -1,13 +1,11 @@
--TEST--
png compression test
--SKIPIF--
<?php
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available.");
}
if (!GD_BUNDLED) {
die("skip external GD libraries always fail");
}
if (!function_exists("imagecreatefrompng") || !function_exists("imagepng")) {
die("skip png support unavailable");
}

View File

@ -1,13 +1,11 @@
--TEST--
xpm --> gd1/gd2 conversion test
--SKIPIF--
<?php
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available.");
}
if (!GD_BUNDLED) {
die("skip external GD libraries always fail");
}
if (!function_exists("imagecreatefromxpm")) {
die("skip xpm read support unavailable");
}

View File

@ -1,13 +1,11 @@
--TEST--
xpm --> jpeg conversion test
--SKIPIF--
<?php
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available.");
}
if (!GD_BUNDLED) {
die("skip external GD libraries always fail");
}
if (!function_exists("imagejpeg")) {
die("skip jpeg support unavailable");
}

View File

@ -1,13 +1,11 @@
--TEST--
xpm --> png conversion test
--SKIPIF--
<?php
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available.");
}
if (!GD_BUNDLED) {
die("skip external GD libraries always fail");
}
if (!function_exists("imagepng")) {
die("skip png support unavailable");
}