From: Pierre Joye Date: Mon, 28 May 2007 17:57:20 +0000 (+0000) Subject: - enable tests even when an external GD is used. Latest releases X-Git-Tag: RELEASE_1_4~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e664dd105723c607baf4e1ee7f690bdbc1febc1;p=php - 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 --- diff --git a/ext/gd/tests/bug19366.phpt b/ext/gd/tests/bug19366.phpt index c83d816c15..0ae588eb2e 100644 --- a/ext/gd/tests/bug19366.phpt +++ b/ext/gd/tests/bug19366.phpt @@ -3,7 +3,6 @@ Bug #19366 (gdimagefill() function crashes (fixed in bundled libgd)) --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- 45) --SKIPIF-- - --FILE-- --FILE-- --FILE-- --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 diff --git a/ext/gd/tests/bug39780_extern.phpt b/ext/gd/tests/bug39780_extern.phpt new file mode 100644 index 0000000000..79ed4f2cf4 --- /dev/null +++ b/ext/gd/tests/bug39780_extern.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #39780 (PNG image with CRC/data error raises a fatal error) +--SKIPIF-- + +--FILE-- + +--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) \ No newline at end of file diff --git a/ext/gd/tests/createfromgd2.phpt b/ext/gd/tests/createfromgd2.phpt index 98b078ea59..e43d1b865b 100644 --- a/ext/gd/tests/createfromgd2.phpt +++ b/ext/gd/tests/createfromgd2.phpt @@ -3,7 +3,6 @@ imagecreatefromgd2 --SKIPIF-- --FILE-- --FILE-- +--FILE-- +"); +} + +//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 diff --git a/ext/gd/tests/dashedlines.phpt b/ext/gd/tests/dashedlines.phpt index 4fa3795cb2..7c13084157 100644 --- a/ext/gd/tests/dashedlines.phpt +++ b/ext/gd/tests/dashedlines.phpt @@ -30,7 +30,6 @@ if ($p1 && $p2 && $p3 && $p4 && $p5) { } imagedestroy($im); - $im = imagecreatetruecolor(6,6); imagefill($im, 0,0, 0xffffff); diff --git a/ext/gd/tests/gif2gd.phpt b/ext/gd/tests/gif2gd.phpt index 75291777d8..3972758dfb 100644 --- a/ext/gd/tests/gif2gd.phpt +++ b/ext/gd/tests/gif2gd.phpt @@ -1,13 +1,11 @@ --TEST-- gif --> gd1/gd2 conversion test --SKIPIF-- - jpeg conversion test --SKIPIF-- - png conversion test --SKIPIF-- - --FILE-- --FILE-- png conversion test --SKIPIF-- - gd1/gd2 conversion test --SKIPIF-- - --FILE-- +--FILE-- + +--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) diff --git a/ext/gd/tests/png2gd.phpt b/ext/gd/tests/png2gd.phpt index d74e888d6c..9c483420a1 100644 --- a/ext/gd/tests/png2gd.phpt +++ b/ext/gd/tests/png2gd.phpt @@ -1,13 +1,11 @@ --TEST-- png <--> gd1/gd2 conversion test --SKIPIF-- - gd1/gd2 conversion test --SKIPIF-- - jpeg conversion test --SKIPIF-- - png conversion test --SKIPIF-- -