#28490 [Opn->Bgs]: function ImageFillToBorder fails to fill the entire zone
| From: | pajoye@php.net | Date: | Sat, 22 May 2004 21:55:02 +0000 |
| Subject: | #28490 [Opn->Bgs]: function ImageFillToBorder fails to fill the entire zone | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-59895@lists.php.net to get a copy of this message | ||
ID: 28490
Updated by: pajoye@php.net
Reported By: philippe dot nonn at capgemini dot com
-Status: Open
+Status: Bogus
Bug Type: GD related
Operating System: Windows XP / IIS
PHP Version: 4.3.6
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
It works as expected. I only looked the non filled arc and compare with
filled area. It is exactly what I expect.
--Pierre
Previous Comments:
------------------------------------------------------------------------
[2004-05-22 23:52:04] pajoye@php.net
Hello,
Are you talking about the lower left gap (at 50 deg)?
Anyway, please provide a script which only fills an area. You can
provide a link to the source and expected result images.
I feel like you should take a look here:
http://www.php.net/imagefilledarc
-- Pierre
------------------------------------------------------------------------
[2004-05-22 20:39:17] philippe dot nonn at capgemini dot com
find above a script showing the part of pie not completely filled of
red color
Philippe
<?php
/*
** Convertir les degrés en radians
*/
function radians($degrees)
{
return($degrees * (pi()/180.0));
}
/*
** prendre x,y dans le cercle,
** centre = 0,0
*/
function circle_point($degrees, $diameter)
{
$x = cos(radians($degrees)) * ($diameter/2);
$y = sin(radians($degrees)) * ($diameter/2);
return (array($x, $y));
}
$image = imagecreate(400, 400 );
//arrière-plan
//couleurs
$colorBody = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
imagefill($image, 0, 0, $colorBody);
$CurrentColor = imagecolorallocate($image, 0xFF, 0x00, 0x00);
$ChartCenterX = 200;
$ChartCenterY =200;
$ChartDiameter = 300;
$StartDegrees = 0;
$EndDegrees = 50;
//dessiner un arc
imagearc($image,
$ChartCenterX,
$ChartCenterY,
$ChartDiameter,
$ChartDiameter,
$StartDegrees,
$EndDegrees,
$CurrentColor);
//Tracer le début de la ligne à partir du centre
list($ArcX, $ArcY) = circle_point($StartDegrees,
$ChartDiameter);
imageline($image,
$ChartCenterX,
$ChartCenterY,
floor($ChartCenterX + $ArcX),
floor($ChartCenterY + $ArcY),
$CurrentColor);
//dessiner la fin de la ligne
list($ArcX, $ArcY) = circle_point($EndDegrees,
$ChartDiameter);
imageline($image,
$ChartCenterX,
$ChartCenterY,
ceil($ChartCenterX + $ArcX),
ceil($ChartCenterY + $ArcY),
$CurrentColor);
if (($EndDegrees - $StartDegrees) > 1)
{
//remplir les portions
$MidPoint = round((($EndDegrees - $StartDegrees)/2) +
$StartDegrees);
list($ArcX, $ArcY) = circle_point($MidPoint,
$ChartDiameter/2);
imagefilltoborder($image,
floor($ChartCenterX + $ArcX),
floor($ChartCenterY + $ArcY),
$CurrentColor,
$CurrentColor);
}
//afficher l'image
header("Content-type: image/jpeg");
imagejpeg($image);
php?>
------------------------------------------------------------------------
[2004-05-22 17:40:03] derick@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.
If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2004-05-22 17:00:42] philippe dot nonn at capgemini dot com
Description:
------------
Using the las version of Graphical Library PHP_GD2 leads to display
images which are only partially filled when using the function
ImageFillToBorder.
It looks like only the upper part of the zone which should be filled
gets the selected color.
The problem doesn't appear when using le 4.3.5 version of php_gd2.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28490&edit=1