imagearc() doesn't like negative value of the s parameter
| Bug #28506 | imagearc() doesn't like negative value of the s parameter | ||||
|---|---|---|---|---|---|
| Submitted: | 2004-05-24 14:49 UTC | Modified: | 2004-05-24 22:04 UTC | ||
| From: | tony2001 at phpclub dot net | Assigned: | pajoye (profile) | ||
| Status: | Closed | Package: | GD related | ||
| PHP Version: | 5CVS-2004-05-24 (dev) | OS: | Linux 2.4.23 | ||
| Private report: | No | CVE-ID: | None | ||
[2004-05-24 14:49 UTC] tony2001 at phpclub dot net
Description: ------------ imagearc() draws broken arc, when using negative value as s parameter. It could be GDlib bug, at least I found a couple of words in GD man: http://www.boutell.com/gd/manual2.0.23.html about unspecified bugs in gdImageArc(). Also, there can be simple workaround: just don't accept negative values, reduce them to zero. Reproduce code: --------------- // result image is here: http://tony2001.phpclub.net/temp/imagearc.png // // create a 200*200 image $img = imagecreate(200, 200); // allocate some colors $white = imagecolorallocate($img, 255, 255, 255); $black = imagecolorallocate($img, 0, 50, 200); // draw a white circle imagearc($img, 100, 100, 150, 150, -1, 200, $black); // output image in the browser header("Content-type: image/png"); imagepng($img); // free memory imagedestroy($img); Expected result: ---------------- a flat arc Actual result: -------------- a broken arc with some crosslines
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2004-05-24 22:04 UTC] pajoye@php.net