1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #51498: imagefilledellipse does not work for large circles
This commit is contained in:
Christoph M. Becker
2021-08-03 16:21:43 +02:00
3 changed files with 23 additions and 2 deletions

View File

@@ -1715,7 +1715,7 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e
void gdImageEllipse(gdImagePtr im, int mx, int my, int w, int h, int c)
{
int x=0,mx1=0,mx2=0,my1=0,my2=0;
long aq,bq,dx,dy,r,rx,ry,a,b;
int64_t aq,bq,dx,dy,r,rx,ry,a,b;
a=w>>1;
b=h>>1;
@@ -1754,7 +1754,7 @@ void gdImageEllipse(gdImagePtr im, int mx, int my, int w, int h, int c)
void gdImageFilledEllipse (gdImagePtr im, int mx, int my, int w, int h, int c)
{
int x=0,mx1=0,mx2=0,my1=0,my2=0;
long aq,bq,dx,dy,r,rx,ry,a,b;
int64_t aq,bq,dx,dy,r,rx,ry,a,b;
int i;
int old_y2;

View File

@@ -0,0 +1,21 @@
--TEST--
Bug #51498 (imagefilledellipse does not work for large circles)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!GD_BUNDLED && version_compare(GD_VERSION, "2.3.0") < 0) {
die("skip test requires GD 2.3.0 or higher");
}
?>
--FILE--
<?php
$img = imagecreatetruecolor(2200, 2200);
$white = imagecolorallocate($img, 255, 255, 255);
imagefilledellipse($img, 1100, 1100, 2200, 2200, $white);
require_once __DIR__ . '/func.inc';
test_image_equals_file(__DIR__ . '/bug51498_exp.png', $img);
?>
--EXPECT--
The images are equal.

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB