[PHP-DEV] Bug #847: imagearc fails with arc from 0 to 360 degrees From: leon <email protected>
Date: 10/15/98

From: leon <email protected>
Operating system: Solaris and Windows NT
PHP version: 3.0.5
PHP Bug Type: Misbehaving function
Bug description: imagearc fails with arc from 0 to 360 degrees

The following script creates a solid black circle in PHP 3.0.4, but in 3.0.5 the call to imagearc fails.

It appears I can draw an arc of at most 360 degrees, which is insufficent for creating a closed loop on circles with diameters bigger than about 200 pixels. Looks like an off-by-one bug.

<?
        $ChartDiameter = 300;
        $ChartWidth = $ChartDiameter + 20;
        $ChartHeight = $ChartDiameter + 20 +
                (($ChartFontHeight + 2) *
                  count($ChartData));
        $ChartCenterX = $ChartDiameter/2 + 10;
        $ChartCenterY = $ChartDiameter/2 + 10;
        
        //create image
        $image = imagecreate($ChartWidth, $ChartHeight);

        //allocate colors
        $colorBody = imagecolorallocate($image, 0xFF,
         0xFF, 0xFF);
        $colorBorder = imagecolorallocate($image, 0x00,
            0x00, 0x00);

        //fill background
        imagefill($image, 0, 0, $colorBody);

        //draw border
        imagearc($image,
                $ChartCenterX,
                $ChartCenterY,
                $ChartDiameter+7,
                $ChartDiameter+7,
                0,
                360,
                $colorBorder);

        imagefilltoborder($image,
                $ChartCenterX,
                $ChartCenterY,
                $colorBorder,
                $colorBorder);

        
        //output image
        header("Content-type: image/gif");
        imagegif($image);
?>

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>