ID: 25678
User updated by: php-bugs at demark dot org
Reported By: php-bugs at demark dot org
-Status: Open
+Status: Bogus
Bug Type: GD related
Operating System: Redhat 7.3 (2.4.20-20.7)
PHP Version: 4.3.3
New Comment:
Looks to be a bug in the GD library. I wrote a quick
program in C to call GD directly and got the same
results.
Previous Comments:
------------------------------------------------------------------------
[2003-09-27 07:58:20] php-bugs at demark dot org
Description:
------------
Neither imageantialias and imagesetthickness seem to work reliably.
The included code produces a significantly different image than one
would expect.
Reproduce code:
---------------
<?php
$im = imagecreatetruecolor(500,500);
$col0 = imagecolorallocate($im,153,204,153);
$col1 = imagecolorallocate($im,118,153,118);
imagefilledrectangle($im,0,0,499,499,$col0);
imageantialias($im,TRUE);
imagesetthickness($im,5);
imagepolygon($im,array(100,100,100,400,400,400,400,100),4,$col1);
imagerectangle($im,150,150,350,350,$col1);
imageline($im,200,200,200,300,$col1);
imageline($im,200,300,300,300,$col1);
imageline($im,300,300,300,200,$col1);
imageline($im,300,200,200,200,$col1);
imageellipse($im,250,250,400,400,$col1);
header("Content-type: image/png");
imagepng($im);
?>
Expected result:
----------------
This code should generate four figures on a 500 x 500 image. Each
figure should be centered on the image.
Figure 1: Small square drawn via imageline
Figure 2: Medium square drawn via imagerectangle
Figure 3: Large square drawn via imagepolygon
Figure 4: Large circle drawn via imageellipse
All figures should be drawn with a 5 pixel thick line.
All figures should be antialiased.
Actual result:
--------------
As listed, the code generates a properly sized image, but none of the
figures are antialiased and only the medium square is set to the proper
thickness. All the other figures are drawn with a 1 pixel thick line.
This image is available at:
http://www.demark.org/phpgdbug/image.png
If I comment out the imageantialias line, no figures are antialiases
(as expected), but only the squares are drawn with the proper
thickness. Once again, the circle is drawn with a 1 pixel thick line.
This image is available at:
http://www.demark.org/phpgdbug/image-noaa.png
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25678&edit=1