From 8e664dd105723c607baf4e1ee7f690bdbc1febc1 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Mon, 28 May 2007 17:57:20 +0000 Subject: [PATCH] - 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 --- ext/gd/tests/bug19366.phpt | 1 - ext/gd/tests/bug22544.phpt | 3 -- ext/gd/tests/bug24155.phpt | 10 ++--- ext/gd/tests/bug24594.phpt | 3 -- ext/gd/tests/bug27582_1.phpt | 1 - ext/gd/tests/bug28147.phpt | 6 +-- ext/gd/tests/bug36697.phpt | 7 +--- ext/gd/tests/bug37346.phpt | 5 +-- ext/gd/tests/bug37360.phpt | 5 +-- ext/gd/tests/bug38112.phpt | 7 +--- ext/gd/tests/bug39082.phpt | 7 +--- ext/gd/tests/bug39273.phpt | 5 +-- ext/gd/tests/bug39286.phpt | 5 +-- ext/gd/tests/bug39366.phpt | 6 +-- ext/gd/tests/bug39508.phpt | 5 +-- ext/gd/tests/bug39780.phpt | 7 ++-- ext/gd/tests/bug39780_extern.phpt | 18 +++++++++ ext/gd/tests/createfromgd2.phpt | 1 - ext/gd/tests/createfromwbmp.phpt | 1 - ext/gd/tests/createfromwbmp2_extern.phpt | 47 ++++++++++++++++++++++++ ext/gd/tests/dashedlines.phpt | 1 - ext/gd/tests/gif2gd.phpt | 6 +-- ext/gd/tests/gif2jpg.phpt | 6 +-- ext/gd/tests/gif2png.phpt | 6 +-- ext/gd/tests/imagefilter.phpt | 10 ++--- ext/gd/tests/imagewbmp.phpt | 1 - ext/gd/tests/jpeg2png.phpt | 6 +-- ext/gd/tests/jpg2gd.phpt | 6 +-- ext/gd/tests/libgd00086.phpt | 6 +-- ext/gd/tests/libgd00086_extern.phpt | 19 ++++++++++ ext/gd/tests/png2gd.phpt | 6 +-- ext/gd/tests/pngcomp.phpt | 6 +-- ext/gd/tests/xpm2gd.phpt | 6 +-- ext/gd/tests/xpm2jpg.phpt | 6 +-- ext/gd/tests/xpm2png.phpt | 6 +-- 35 files changed, 141 insertions(+), 106 deletions(-) create mode 100644 ext/gd/tests/bug39780_extern.phpt create mode 100644 ext/gd/tests/createfromwbmp2_extern.phpt create mode 100644 ext/gd/tests/libgd00086_extern.phpt 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-- -