|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-09-28 18:57 UTC] php-bugs at demark dot org
[2013-09-09 08:18 UTC] adolf at sharklasers dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 20:00:01 2025 UTC |
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