|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28506 imagearc() doesn't like negative value of the s parameter
Submitted: 2004-05-24 14:49 UTC Modified: 2004-05-24 22:04 UTC
From: tony2001 at phpclub dot net Assigned: pajoye (profile)
Status: Closed Package: GD related
PHP Version: 5CVS-2004-05-24 (dev) OS: Linux 2.4.23
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: tony2001 at phpclub dot net
New email:
PHP Version: OS:


 [2004-05-24 14:49 UTC] tony2001 at phpclub dot net
imagearc() draws broken arc, when using negative value as s parameter.
It could be GDlib bug, at least I found a couple of words in GD man: about unspecified bugs in gdImageArc().
Also, there can be simple workaround: just don't accept negative values, reduce them to zero.

Reproduce code:
// result image is here:
// create a 200*200 image
$img = imagecreate(200, 200);

// allocate some colors
$white = imagecolorallocate($img, 255, 255, 255);
$black = imagecolorallocate($img, 0, 50, 200);
// draw a white circle 
imagearc($img, 100, 100, 150, 150, -1, 200, $black);

// output image in the browser
header("Content-type: image/png");
// free memory

Expected result:
a flat arc

Actual result:
a broken arc with some crosslines


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-24 22:04 UTC]
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
Thank you for the report, and for helping us make PHP better.

while (s < 0) s += 360 is used now.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 05 11:01:28 2024 UTC