mitoteam / jpgraph

JpGraph library composer package with PHP 8.4 support
https://packagist.org/packages/mitoteam/jpgraph
Other
36 stars 5 forks source link

Implicit conversion from float 113.49999999999999 to int loses precision #1

Closed durip closed 2 years ago

durip commented 2 years ago

Hi, I try jpgraph with PHP 8.1 and when I want to display error $e = new JpGraphException('not enough data to plot the graph!'); $e->Stroke(); error message show: Implicit conversion from float 113.49999999999999 to int loses precision jpgraph_rgb.inc.php:562] imagecolorresolvealpha() gd_image.inc.php:1128] RGB->Allocate() jpgraph_errhandler.inc.php:305] Image->SetColor() jpgraph_errhandler.inc.php:156] JpGraphErrObjectImg->Raise()

f1mishutka commented 2 years ago

@durip , thank you for first feedback!

Just pushed fix for your issue to "main" branch. Could you please confirm it works fine now? I'll release v10.0.1 if there are no other issues for now.

durip commented 2 years ago

hi @f1mishutka,

unfortunately it doesnt work. This help:

return imagecolorresolvealpha($this->img, (int)$r, (int)$g, (int)$b, round($aAlpha * 127));

f1mishutka commented 2 years ago

@durip , thank you!

Pushed your fix to "main" and released v10.0.1 for those who using composer.

Please feel free to report any other issues.