From:             php-bugs at demark dot org
Operating system: Redhat 7.3 (2.4.20-20.7)
PHP version:      4.3.3
PHP Bug Type:     GD related
Bug description:  Issues with imageantialias and imagesetthickness

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 bug report at http://bugs.php.net/?id=25678&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25678&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25678&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25678&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25678&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25678&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25678&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25678&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25678&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25678&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25678&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25678&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25678&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25678&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25678&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25678&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=25678&r=float

Reply via email to