|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #45552 Full circle drawn instead of arc with very small angle
Submitted: 2008-07-18 09:27 UTC Modified: 2021-08-25 11:55 UTC
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: Assigned: pajoye (profile)
Status: Wont fix Package: GD related
PHP Version: * OS: Linux 2.6.25-gentoo-r6
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-07-18 09:27 UTC]
Instead of a very small arc slice, a full circle is drawn when calling imagefilledarc with very small angles.

Reproduce code:

$image = imagecreatetruecolor( 200, 200 );

$bgColor = imagecolorallocatealpha( $image, 255, 255, 255, 127 );
imagealphablending( $image, true );
imagesavealpha( $image, true );
imagefill( $image, 1, 1, $bgColor );

$drawColor = imagecolorallocate( $image, 0, 0, 200 );
imagefilledarc( $image, 100, 100, 100, 100, 30, 30.1, $drawColor, IMG_ARC_PIE );

imagepng( $image, 'imagefilledarc_test.png' );

Expected result:
An image with a very small arc slice.

Actual result:
A full circle, like:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-26 16:26 UTC] michal dot dziemianko at gmail dot com
For me it does not seem to be a bug. In the documentation the following declaration is given:

bool imagefilledarc  ( resource $image  , int $cx  , int $cy  , int $width  , int $height  , int $start  , int $end  , int $color  , int $style  )

Your 30.1 is truncated to 30 (conversion to int), then the function is called with parameters $start=30 and $end =30. 

Please note that start and end values are *angles* at which the arc starts/ends with respect to 0 degrees. As both start and end are 30 then it is full circle (drawing starts at 30degrees and goes clockwise all the way round until 30degrees is hit again). That is behaving as expected I think. 

 [2008-11-25 19:52 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

 [2008-11-25 19:53 UTC]
It is more like a feature request.
 [2015-05-07 18:24 UTC]
-Type: Bug +Type: Feature/Change Request
 [2017-01-22 23:36 UTC]
-Status: Assigned +Status: Suspended
 [2017-01-22 23:36 UTC]
As this is a general libgd issue, I've forwarded the request to
<>, and suspend this
ticket for the time being.
 [2021-07-13 04:06 UTC]
This may benefit from a coming vector 2D support in GD:

I don't think that will be fixed before (won't be accurate).
 [2021-08-25 11:55 UTC]
-Status: Suspended +Status: Wont fix
 [2021-08-25 11:55 UTC]
Good point.  So I'm closing this as WONTFIX.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Sep 30 17:01:24 2023 UTC