php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43010 imagefilledarc() incorrect fill for certain start/end angles
Submitted: 2007-10-17 21:49 UTC Modified: 2007-10-20 15:31 UTC
From: johanp at aditus dot nu Assigned: pajoye (profile)
Status: Closed Package: GD related
PHP Version: 4.4.7 OS: Linux
Private report: No CVE-ID: None
 [2007-10-17 21:49 UTC] johanp at aditus dot nu
Description:
------------
In PHP 4.4.7 imagefilledarc() has a defect filling a full circle when the start angle is not =0

Reproduce code:
---------------
<?php

$im = imagecreatetruecolor (600, 400);
$black = imagecolorallocate ($im, 0, 0, 0);
$white = imagecolorallocate ($im, 255, 255, 255);

// The following code should show two white circles. But
// only the left arc is displayed

// 360-arc working. (Start angle=0, End Angle=360) 
imagefilledarc($im,200,200,200,200,0,360,$white,IMG_ARC_PIE);

// 360-arc __NOT__ working. (Start angle=270, End Angle=630) 
imagefilledarc($im,400,200,200,200,270,630,$white,IMG_ARC_PIE);

header ("Content-type: image/png");
imagepng ($im);

?>


Expected result:
----------------
Two white circles on a black canvas

Actual result:
--------------
One white circle on a black canvas

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-17 22:02 UTC] johanp at aditus dot nu
This is a regression in 4.4.7 since this is working in 4.4.6
 [2007-10-20 09:35 UTC] johanp at aditus dot nu
This is broken in 5.2.0 as well
 [2007-10-20 10:38 UTC] scottmac@php.net
This was fixed in PHP 5.2.4, the regression was only introduced in PHP 5.2.3.

The fix for the regression was never made back to 4.4, I'll try to do this at the weekend if Pierre doesn't get around to it.
 [2007-10-20 15:31 UTC] pajoye@php.net
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.

It is not broken in 5.2 _snapshot_ and as far as I remember, it should work as well in 5.2.4.

By the way, this regression was introduced two releases ago and affects arcs with equivalent start and end angles and the start angle is different than zero.

Fixed in CVS.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 03:01:29 2024 UTC