Edit report at https://bugs.php.net/bug.php?id=63814&edit=1

 ID:                 63814
 Comment by:         r...@php.net
 Reported by:        webmaster at fxtop dot com
 Summary:            angles parameters in imagefilledarc are integers,
                     they should be float
 Status:             Open
 Type:               Feature/Change Request
 Package:            GD related
 Operating System:   Windows
 PHP Version:        5.4.9
 Block user comment: N
 Private report:     N

 New Comment:

the gd extension is mostly a wrapper for gd library.

As gd library doesn't accept float values for this comment, I think this is not 
possible.


Previous Comments:
------------------------------------------------------------------------
[2012-12-20 12:32:55] webmaster at fxtop dot com

Description:
------------
see sample result at
http://mon-convertisseur.fr/php/imgangle.php?DEGRE=172.3

angles are truncated to nearest integer, in imagefilledarc function, they 
shouldn't

you can change parameter if you like

---
>From manual page: 
>http://www.php.net/function.imagefilledarc#refsect1-function.imagefilledarc-description
---



Test script:
---------------
header("Content-type: image/jpeg");

if (isset($_GET["DEGRE"])){ $lDegre=$_GET["DEGRE"];}
$lSizeX=916;
$lSizeY=945;
$image  = imagecreatetruecolor($lSizeX, $lSizeY);
$colorGreen = imagecolorallocate($image, 0, 255, 0);
                
// background coming from 
http://commons.wikimedia.org/wiki/File:Protractor_katomierz.jpg with some 
little changes
$fond=imagecreatefromjpeg("Protractor_katomierz_tourne05b.jpg");

//HERE I ROUND DEGRE PARAMETER BECAUSE imagefilledarc only accept integers (I 
prefer it rounded than truncated)
$lNumDegre=round($lDegre);
$lResult|=imagefilledarc ($image , 460 , 474 , 2*430 , 2*430  , -$lNumDegre , 
0, $colorGreen , IMG_ARC_PIE );
$lResult|=imagecopymerge($image, $fond, 0, 0, 0 , 0, $lSizeX,$lSizeY,75);
imagejpeg($image, "temp.jpg");
imagedestroy($image);
echo file_get_contents("temp.jpg");

Expected result:
----------------
imagefilledarc should accept float parameters for "start" and "end" parameters.
As you can see on sample at 
http://mon-convertisseur.fr/php/imgangle.php?DEGRE=172.3 green backgound 
allways fall on a degre graduation  of the protactor. 




------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63814&edit=1

Reply via email to