mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Fix #51498: imagefilledellipse does not work for large circles
We backport the respective upstream fix[1].
[1] <ace7fd88dc
>
Closes GH-7329.
This commit is contained in:
parent
d1ccb5bd0c
commit
c565555f03
4 changed files with 25 additions and 2 deletions
3
NEWS
3
NEWS
|
@ -15,6 +15,9 @@ PHP NEWS
|
||||||
- CGI:
|
- CGI:
|
||||||
. Fixed bug #80849 (HTTP Status header truncation). (cmb)
|
. Fixed bug #80849 (HTTP Status header truncation). (cmb)
|
||||||
|
|
||||||
|
- GD:
|
||||||
|
. Fixed bug #51498 (imagefilledellipse does not work for large circles). (cmb)
|
||||||
|
|
||||||
- PDO_ODBC:
|
- PDO_ODBC:
|
||||||
. Fixed bug #81252 (PDO_ODBC doesn't account for SQL_NO_TOTAL). (cmb)
|
. Fixed bug #81252 (PDO_ODBC doesn't account for SQL_NO_TOTAL). (cmb)
|
||||||
|
|
||||||
|
|
|
@ -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)
|
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;
|
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;
|
a=w>>1;
|
||||||
b=h>>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)
|
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;
|
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 i;
|
||||||
int old_y2;
|
int old_y2;
|
||||||
|
|
||||||
|
|
20
ext/gd/tests/bug51498.phpt
Normal file
20
ext/gd/tests/bug51498.phpt
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #51498 (imagefilledellipse does not work for large circles)
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
if (!extension_loaded('gd')) die("skip gd extension not available");
|
||||||
|
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.
|
BIN
ext/gd/tests/bug51498_exp.png
Normal file
BIN
ext/gd/tests/bug51498_exp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
Loading…
Add table
Add a link
Reference in a new issue