php-src/ext/gd/tests/bug19366.phpt

53 lines
1.4 KiB
Plaintext
Raw Normal View History

2002-10-09 13:48:28 +00:00
--TEST--
2005-04-03 11:17:54 +00:00
Bug #19366 (gdimagefill() function crashes (fixed in bundled libgd))
2002-10-09 13:54:21 +00:00
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
2002-11-15 15:22:07 +00:00
?>
2002-10-09 13:48:28 +00:00
--FILE--
<?php
2003-05-19 21:48:04 +00:00
echo "Alive: create image\n";
2002-10-09 13:48:28 +00:00
$width = 50;
$height = 100;
$ImHandle = imagecreate($width,$height);
2003-05-19 21:48:04 +00:00
echo "Alive: Define colors\n";
2002-10-09 13:48:28 +00:00
$MyBlue = imagecolorAllocate($ImHandle, 0, 0, 255);
$MyRed = imagecolorAllocate($ImHandle, 255, 0, 0);
$MyWhite = imagecolorAllocate($ImHandle, 255, 255, 255);
$MyBlack = imagecolorAllocate($ImHandle, 0, 0, 0);
2003-05-19 21:48:04 +00:00
echo "Alive: Draw\n";
2002-10-09 13:48:28 +00:00
ImageFill($ImHandle,0,0,$MyBlack);
ImageLine($ImHandle,20,20,180,20,$MyWhite);
ImageLine($ImHandle,20,20,20,70,$MyBlue);
ImageLine($ImHandle,20,70,180,70,$MyRed);
ImageLine($ImHandle,180,20,180,45,$MyWhite);
ImageLine($ImHandle,180,70,180,45,$MyRed);
ImageLine($ImHandle,20,20,100,45,$MyBlue);
ImageLine($ImHandle,20,70,100,45,$MyBlue);
ImageLine($ImHandle,100,45,180,45,$MyRed);
ImageFill($ImHandle,21,45,$MyBlue);
ImageFill($ImHandle,100,69,$MyRed);
ImageFill($ImHandle,100,21,$MyWhite);
2003-05-19 21:48:04 +00:00
echo "Alive: ImageString\n";
2002-10-09 13:48:28 +00:00
ImageString($ImHandle,4,40,75,"Czech Republic",$MyWhite);
2003-05-19 21:48:04 +00:00
echo "Alive: Send to browser\n";
//Header("Content-type: image/PNG");
2002-10-09 13:48:28 +00:00
//ImagePNG($ImHandle);
2003-05-19 21:48:04 +00:00
echo "Alive: Free resources\n";
2002-10-09 13:48:28 +00:00
imagedestroy($ImHandle);
2003-05-19 21:48:04 +00:00
echo "Alive: Done\n";
2002-10-09 13:48:28 +00:00
?>
--EXPECT--
2003-05-19 21:48:04 +00:00
Alive: create image
Alive: Define colors
Alive: Draw
Alive: ImageString
Alive: Send to browser
Alive: Free resources
Alive: Done