|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-09-17 04:41 UTC] chinhnt2k3 at yahoo dot com
Description:
------------
imagefilledellipse() produces an ellipse with a different size if the size is even.
Reproduce code:
---------------
<?php
$image = imagecreatetruecolor(200, 200);
$color = imagecolorallocate($image, 255, 255, 255);
imagefilledellipse($image, 100, 100, 26, 26, $color);
header("Content-type: image/png");
imagepng($image);
?>
Expected result:
----------------
An ellipse with the size of 26.
Actual result:
--------------
An ellipse with the size of 27.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 14:00:01 2025 UTC |
Reproduced error on the following: * PHP Version 5.2.5 * GD Library bundled (2.0.34 compatible) ** IIS 5.1 on Windows XP Professional ** Apache/2.2.9 (Win32) on Windows XP Professional Reproduce code: <?php $radius = 100; $corner_image = imagecreatetruecolor( $radius * 2, $radius * 2 ); $clear_colour = imagecolorallocate( $corner_image, 0, 0, 0 ); $solid_colour = imagecolorallocate( $corner_image, 0xFF, 0, 0 ); imagefill( $corner_image, 0, 0, $solid_colour ); imagefilledellipse( $corner_image, $radius, $radius, $radius * 2, $radius * 2, $clear_colour ); header( "Content-type: image/png" ); imagepng( $corner_image ); ?> Expected output: * 200x200 black circle inside 200x200 red square, perfect fit Actual output: * 201x201 black circle inside 200x200 red square, the right side of circle clearly appears "clipped"