#41717 [Opn->Csd]: Problem with imagethickness() and imagepolygon()
| From: | pajoye@php.net | Date: | Sun, 17 Jun 2007 10:58:10 +0000 |
| Subject: | #41717 [Opn->Csd]: Problem with imagethickness() and imagepolygon() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-113870@lists.php.net to get a copy of this message | ||
ID: 41717
Updated by: pajoye@php.net
Reported By: c dot bezemer at student dot tudelft dot nl
-Status: Open
+Status: Closed
Bug Type: GD related
Operating System: windows and linux
PHP Version: 5.2.3
-Assigned To:
+Assigned To: pajoye
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Thanks for this report!
Previous Comments:
------------------------------------------------------------------------
[2007-06-16 23:50:42] c dot bezemer at student dot tudelft dot nl
Description:
------------
When drawing a polygon with the default thickness everything is fine;
but when setting the thickness of the line > 1, I get strange results.
It looks as if certain lines of the polygons are not being drawn with
the correct thickness.
Reproduce code:
---------------
function getPolygon($width, $border_width, $sides)
{
$xcen = $width; $ycen = $width; $incr = 360/$sides;
$angle = 180; $k = 0; $max_height = 0;
for($j = 0; $j < $sides; $j++)
{
$points[$k] = $xcen + $width * sin(deg2rad($angle)) +
$border_width;
$k++;
$points[$k] = $ycen + $width * cos(deg2rad($angle)) +
$border_width;
$max_height = max($max_height, $points[$k]);
$k++;
$angle += $incr;
}
$img = imagecreatetruecolor(2*$width+10,
$max_height+$border_width+10);
$bg = imagecolorallocate($img,255,255,255);
ImageFill($img, 0, 0, $bg);
imagecolorallocate($img, 255, 255, 255);
$black = imagecolorallocate($img,0,0,0);
imagesetthickness($img,$border_width);
imagepolygon($img,$points,$sides,$black);
header("Content-type: image/gif"); imagegif ($img);
imagedestroy($img);
}
getPolygon(100, 5, 9);
Expected result:
----------------
For 9 sides, it should be like http://www.gabber.nl/cp/geometry_1px.gif
with a thicker line.
Actual result:
--------------
The output is http://www.gabber.nl/cp/geometry_5px.gif . This
happens
for most values of sides.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41717&edit=1