From: swanand dot raikar at gmail dot com
Operating system: Windows XP
PHP version: 5.2.5
PHP Bug Type: GD related
Bug description: filled Polygon is not visible after creating it 129th time in
same image
Description:
------------
I have a function which creates a polygon of blue color. I call this
function inside a loop of 128 iterations. For every iteration, i change the
value of x and y so that my polygon is rendered on new location. This goes
fine and i get 128 new polygons on my image after running the script. But
if change the number to 129, the 129th polygon is transparent or what i
cannot guess.It just does not display or render at all. Is this a bug or
some mistake with my code?
I am using php version 5.1.4 that came with WAMP5 Version 1.6.3
Reproduce code:
---------------
$im = imagecreate(600, 400);
$x = 20;
$y = 350;
for($i=1;$i<=128;$i++) //create a polygon 128 times
{
drawPoly($x,$y,$im);
$x = $x+2;
$y = $y-2;
}
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
function drawPoly($xCoord,$yCoord,$im)
{
$x1 = $x2 = $xCoord;
$x3 = $x4 = $xCoord + 70;
$y1 = $y4 = $yCoord;
$y2 = $y3 = $yCoord + 30;
$Poly = array(0 => $x1,1 => $y1,2 => $x2,3 => $y2,4 =>
$x3,5 =>
$y3,6 => $x4,7 => $y4);
$bg = imagecolorallocate($im, 150, 150, 150);
$blue = imagecolorallocate($im, 0, 0, 255);
imagefilledpolygon($im, $Poly, 4, $blue);
}
Expected result:
----------------
i expect to see the polygon even after my loop exceeds 128
Actual result:
--------------
What i can see now is only 128 polygons created perfectly not more than
that.
--
Edit bug report at http://bugs.php.net/?id=44491&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=44491&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=44491&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=44491&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44491&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=44491&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44491&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44491&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44491&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44491&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44491&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=44491&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=44491&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44491&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44491&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=44491&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44491&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44491&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44491&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44491&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44491&r=mysqlcfg