Edit report at https://pear.php.net/bugs/bug.php?id=18549&edit=1
ID: 18549
Updated by: daniel.oconnor@gmail.com
Reported By: jblank at twu dot net
Summary: setThickness not working on GD / PNG output
Status: Open
Type: Bug
Package: Image_Canvas
Operating System: Debian
Package Version: 0.3.3
PHP Version: Irrelevant
Roadmap Versions:
New Comment:
clockwerx@clockwerx-desktop:~/pear-svn-git/Image_Canvas$ patch -p1 <
patch-
download.php\?id\=18549\&patch\=GD-check-line-thickness-enable-
0width\&revision\=1305766242
patch: **** Only garbage was found in the patch input.
Previous Comments:
------------------------------------------------------------------------
[2011-05-19 00:53:29] jessieleah
Submitted a patch to fix this bug via a simple workaround: If the user
has set a particular line's thickness to something other than the
default, that line will NOT be drawn antialiased.
Furthermore, I added correct support for zero-width lines (i.e.: they do
not draw at all, as expected).
Patch notes: I added a trivial _getLineThickness() function and had
GD.php call it when it is about to draw a data series; if the line
thickness is set, then it does not attempt to draw that line
anti-aliased.
Example output:
Here is a matched pair of outputs, one for GD/PNG, one for SVG. You'll
notice that they match fairly closely, as they should. Prior to my fix,
the PNG output was unrecognisable; it had two very thin (default line
width) lines in place of the thick (width of 15) line and the 0-width
line (which should not have been drawn at all, leaving only the points,
as shown).
http://twu.net/~jblank/pngoutput2.png
http://twu.net/~jblank/svgoutput2.png
------------------------------------------------------------------------
[2011-05-19 00:50:42] jessieleah
Added #patch
bug:18549;patch:GD-check-line-thickness-enable-0width;revision:1305766242;.
------------------------------------------------------------------------
[2011-05-19 00:50:03] jessieleah
Description:
------------
setThickness does not work at all on GD output wherever
antialiasing is enabled; all lines are the same width, regardless of
what the user attempts to set their thickness to.
Expected result:
----------------
The thickness set by setThickness() is honoured.
Actual result:
--------------
All lines are drawn at an identical thickness (even 0-width lines,
which shouldn't show up at all).
------------------------------------------------------------------------