summaryrefslogtreecommitdiff
path: root/ext/gd/tests/bug19366.phpt
blob: 5e4d7285b3913abfccb79ea7c4858388cb24e6a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
--TEST--
gdimagefill() function (Bug #19366 (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
echo "Alive\n";
$width = 50;
$height = 100;
$ImHandle = imagecreate($width,$height);
echo "Alive\n";
//Define colors
$MyBlue = imagecolorAllocate($ImHandle, 0, 0, 255);
$MyRed = imagecolorAllocate($ImHandle, 255, 0, 0);
$MyWhite = imagecolorAllocate($ImHandle, 255, 255, 255);
$MyBlack = imagecolorAllocate($ImHandle, 0, 0, 0);
echo "Alive\n";
//Draw
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);
ImageString($ImHandle,4,40,75,"Czech Republic",$MyWhite);
echo "Alive\n";
// Send to browser
Header("Content-type: image/PNG");
//ImagePNG($ImHandle);
echo "Alive\n";
//Free resources
imagedestroy($ImHandle);
echo "Alive\n";
?>
--EXPECT--
Alive
Alive
Alive
Alive
Alive
Alive