Edit report at http://pear.php.net/bugs/bug.php?id=18549&edit=1

ID: 18549
Comment by: jblank@twu.net
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:

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

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).


Previous Comments:

[2011-05-19 00:50:42] jessieleah

Added #patch


[2011-05-19 00:50:03] jessieleah

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).


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
postedMay 18, '11 at 11:53p
activeMay 18, '11 at 11:53p

1 user in discussion

Jblank: 1 post



site design / logo © 2022 Grokbase