Req #63814 [NEW]: angles parameters in imagefilledarc are integers, they should be float
From: webmaster at fxtop dot com
Operating system: Windows
PHP version: 5.4.9
Package: GD related
Bug Type: Feature/Change Request
Bug description:angles parameters in imagefilledarc are integers, they should be float
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 bug report at https://bugs.php.net/bug.php?id=63814&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63814&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63814&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63814&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63814&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63814&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63814&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63814&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63814&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63814&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63814&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=63814&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=63814&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63814&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63814&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63814&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63814&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63814&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63814&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63814&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63814&r=mysqlcfg
Thread (5 messages)
- webmaster at fxtop dot com