|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51593 imageellipse() draws incorrectly
Submitted: 2010-04-18 23:17 UTC Modified: 2015-07-11 17:11 UTC
Avg. Score:4.0 ± 0.8
Reproduced:8 of 8 (100.0%)
Same Version:2 (25.0%)
Same OS:2 (25.0%)
From: ellipsebugs at yahoo dot com Assigned: cmb (profile)
Status: Duplicate Package: GD related
PHP Version: 5.3.2 OS: Windows XP
Private report: No CVE-ID: None
 [2010-04-18 23:17 UTC] ellipsebugs at yahoo dot com
On a system of Window XP, PHP/5.3.0 and GD 2.0.34 the imageellipse() function fails to draw a circle properly when dealing with large dimensions.

Calling the function for a circle with radius over 1032 pixels (an ellipse with equal width and height over 2064 pixels) creates a deformed circle with bumps in four directions. Increasing the dimensions makes things worse.

On a system of Linux, PHP/5.2.13 and GD 2.0.34 the issue does not appear.

Test script:

header ("Content-type: image/png");
$im = imagecreatetruecolor(2200, 2200) or die("Cannot Initialize new GD image stream");
imagefill($im, 0, 0, imagecolorallocate($im, 255, 255, 255));
imageellipse($im, 1100, 1100, 2064, 2064, imagecolorallocate($im, 0, 0, 255));


Expected result:
A relatively smooth circle is drawn.

Actual result:
The resulting circle has irregular bumps in it.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-24 20:03 UTC] blyon at blyon dot com
I'm having the same problem with large ellipses on FreeBSD, I am trying to do 
ellipses > 1000 pixels and they look like bumpy squares:

PHP 5.2.6 with Suhosin-Patch (cli) (built: Oct 21 2008 18:22:59) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
 [2012-06-07 11:40 UTC] merlijn at bntnederland dot nl
Running into the same problem on a freeBSD Server/5.3.10/gd2.0.34.
Stupid thing is that on my developmentserver, which has the same software specs, 
the problem doesn't exist. When I moved my script to the production server it 
popped up.

As far I can tell the only difference is that my production server runs an 64bit 
OS and my development server an 32bit version of freeBSD (both run 8.2).
 [2015-01-22 13:16 UTC] luke at woollysheep dot net
same problem into linux slackware but the size must be > than 2200
PHP version: 5.6.4
GD version: bundled (2.1.0 compatible)
 [2015-04-08 09:10 UTC] gimli2 at gmail dot com
The same problem is in PHP 5.5.23 x64 on win7 x64. with GD Version: bundled (2.1.0 compatible))
 [2015-07-11 17:11 UTC]
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2015-07-11 17:11 UTC]
Duplicate of bug #51498.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 05:01:27 2024 UTC