php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51498 imagefilledellipse does not work for large circles
Submitted: 2010-04-07 17:02 UTC Modified: 2017-08-16 16:28 UTC
Votes:4
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:1 (25.0%)
From: thomas dot sahlin at invented dot se Assigned:
Status: Suspended Package: GD related
PHP Version: 5.6.10 OS: 32bit,LLP64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: thomas dot sahlin at invented dot se
New email:
PHP Version: OS:

 

 [2010-04-07 17:02 UTC] thomas dot sahlin at invented dot se
Description:
------------
When drawing really large circles (diameter >= 2100) using imagefilledellipse, the circles get distorted.

Test script:
---------------
$img = imagecreatetruecolor(2200, 2200);
$white = imagecolorallocate($img, 255, 255, 255);
imagefilledellipse($img, 1100, 1100, 2200, 2200, $white);
imagepng($img, '/tmp/test.png');
imagedestroy($img);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-06-10 22:48 UTC] matthew at dps dot uk dot com
Same issues with imagearc
 [2015-06-28 18:41 UTC] cmb@php.net
-Status: Open +Status: Suspended -Operating System: Ubuntu +Operating System: 32bit,LLP64 -PHP Version: 5.2.13 +PHP Version: 5.6.10 -Assigned To: +Assigned To: cmb
 [2015-06-28 18:41 UTC] cmb@php.net
This happens also for imageellipse(). The code[1] shows, that
it is an integer overflow issue in libgd. Consider w = h = 2200.
Then

a = 1100
b = 1100
aq = 1210000
bq = 1210000
dx = 2420000
dy = 2420000
r = 1331000000
rx = 2662000000

The value of rx doesn't really fit in a signed 32bit variable.
However, long is 32bit on 32bit architectures and on LLP64 (e.g.
Windows). Therefore the supplied test script fails on these
architectures, but works on most 64bit Unix-like systems.

I have reported the issue upstream[2] and suspend this ticket
until the problem is resolved in libgd.

[1] <http://lxr.php.net/xref/PHP_TRUNK/ext/gd/libgd/gd_arc.c#17>
[2] <https://github.com/libgd/libgd/issues/169>
 [2017-08-16 16:28 UTC] cmb@php.net
-Assigned To: cmb +Assigned To:
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Wed Nov 21 18:01:27 2018 UTC