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

------------------------------------------------------------------------

Search Discussions

  • Daniel Oconnor at Jan 2, 2012 at 12:28 am
    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
    +Status: Closed
    Type: Bug
    Package: Image_Canvas
    Operating System: Debian
    Package Version: 0.3.3
    PHP Version: Irrelevant
    -Assigned To:
    +Assigned To: doconnor
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Closed
    -Assigned To:
    +Assigned To: doconnor
    This bug has been fixed in SVN.

    If this was a documentation problem, the fix will appear on pear.php.net
    by the end of next Sunday (CET).

    If this was a problem with the pear.php.net website, the change should
    be live shortly.

    Otherwise, the fix will appear in the package's next release.

    Thank you for the report and for helping us make PEAR better.

    Applied manually to Git. Can you take a look & reopen this if I've done
    it wrong?


    Previous Comments:
    ------------------------------------------------------------------------

    [2012-01-02 01:23:59] doconnor

    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.

    ------------------------------------------------------------------------

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

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJan 2, '12 at 12:23a
activeJan 2, '12 at 12:28a
posts2
users1
websitepear.php.net

1 user in discussion

Daniel Oconnor: 2 posts

People

Translate

site design / logo © 2022 Grokbase