Req #28761 [Opn]: thick line endings drawn with imageline() are ugly
| From: | cmb@php.net | Date: | Mon, 07 Sep 2015 17:19:30 +0000 |
| Subject: | Req #28761 [Opn]: thick line endings drawn with imageline() are ugly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-195857@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=28761&edit=1
ID: 28761
Updated by: cmb@php.net
Reported by: odarcan at hotmail dot com
-Summary: lines drawn with imageline() are ugly
+Summary: thick line endings drawn with imageline() are ugly
Status: Open
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: GD related
Operating System: win xp
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
I agree that this should be improved. Furthermore being able to
choose the desired line-caps ("butt", "round", "square") would be
nice.
Previous Comments:
------------------------------------------------------------------------
[2004-06-13 06:18:48] odarcan at hotmail dot com
clarification:
the uglyness appears in the junctions of different lines when the first one's ending coords. is
the second one's beginning coords., the drawn lines should be more seamless
------------------------------------------------------------------------
[2004-06-13 06:13:25] odarcan at hotmail dot com
Description:
------------
i dont think this is a bug, it may be, and i dont know if reporting this here will do any good,
when drawing lines in gd, other than 90degree angles; the endings of the lines always become
horisontal
and it looks really, REALLY cheap! it doesnt show when the lines are 1 pixel wide but when drawing
thicker lines, it becomes VERY obvious, this is my greatest obstacle in my project right now, ive
emailed boutell.com but got no answer.
thanks,
Osman Darcan
Reproduce code:
---------------
<?
$im = imagecreate(400, 400) or die ("Cannot Initialize new GD image stream");
header ("Content-type: image/png");
$grey = imagecolorallocate ($im, 155, 155, 155);
$blue = imagecolorallocate ($im, 0, 0, 255);
$green = imagecolorallocate ($im, 0, 155, 0);
imagesetthickness($im,9);
imageline($im,5,5,50,50,$blue);
imageline($im,50,50,100,300,$blue);
imageline($im,100,300,300,40,$blue);
imageline($im,5+20,5+20,50+20,50+20,$green);
imageline($im,50+20,50+20,60+20,300+20,$green);
imageline($im,100+20,300+20,300+20,40+20,$green);
imagepng($im,"",60);
?>
Expected result:
----------------
try different values for imagesetthickness
Actual result:
--------------
you'll see that some lines look very weird.. im not sure its a bug but it's sure ugly
allright..
php and gd deserves something as simple as a decent option to set thickness to lines.. shouldnt be
so hard to implement?
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=28761&edit=1