Annotation of embedaddon/php/ext/gd/tests/bug19366.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #19366 (gdimagefill() function crashes (fixed in bundled libgd))
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded('gd')) die("skip gd extension not available\n");
! 6: ?>
! 7: --FILE--
! 8: <?php
! 9: echo "Alive: create image\n";
! 10: $width = 50;
! 11: $height = 100;
! 12: $ImHandle = imagecreate($width,$height);
! 13:
! 14: echo "Alive: Define colors\n";
! 15: $MyBlue = imagecolorAllocate($ImHandle, 0, 0, 255);
! 16: $MyRed = imagecolorAllocate($ImHandle, 255, 0, 0);
! 17: $MyWhite = imagecolorAllocate($ImHandle, 255, 255, 255);
! 18: $MyBlack = imagecolorAllocate($ImHandle, 0, 0, 0);
! 19:
! 20: echo "Alive: Draw\n";
! 21: ImageFill($ImHandle,0,0,$MyBlack);
! 22: ImageLine($ImHandle,20,20,180,20,$MyWhite);
! 23: ImageLine($ImHandle,20,20,20,70,$MyBlue);
! 24: ImageLine($ImHandle,20,70,180,70,$MyRed);
! 25: ImageLine($ImHandle,180,20,180,45,$MyWhite);
! 26: ImageLine($ImHandle,180,70,180,45,$MyRed);
! 27: ImageLine($ImHandle,20,20,100,45,$MyBlue);
! 28: ImageLine($ImHandle,20,70,100,45,$MyBlue);
! 29: ImageLine($ImHandle,100,45,180,45,$MyRed);
! 30: ImageFill($ImHandle,21,45,$MyBlue);
! 31: ImageFill($ImHandle,100,69,$MyRed);
! 32: ImageFill($ImHandle,100,21,$MyWhite);
! 33:
! 34: echo "Alive: ImageString\n";
! 35: ImageString($ImHandle,4,40,75,"Czech Republic",$MyWhite);
! 36:
! 37: echo "Alive: Send to browser\n";
! 38: //Header("Content-type: image/PNG");
! 39: //ImagePNG($ImHandle);
! 40:
! 41: echo "Alive: Free resources\n";
! 42: imagedestroy($ImHandle);
! 43: echo "Alive: Done\n";
! 44: ?>
! 45: --EXPECT--
! 46: Alive: create image
! 47: Alive: Define colors
! 48: Alive: Draw
! 49: Alive: ImageString
! 50: Alive: Send to browser
! 51: Alive: Free resources
! 52: Alive: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>