Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.4.0

Bug #18549 setThickness not working on GD / PNG output
Submitted: 2011-05-19 04:50 UTC
From: jessieleah Assigned: doconnor
Status: Closed Package: Image_Canvas (version 0.3.3)
PHP Version: Irrelevant OS: Debian
Roadmaps: (Not assigned)    
Subscription  


 [2011-05-19 04:50 UTC] jessieleah (Jessica Blank)
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).

Comments

 [2011-05-19 04:50 UTC] jessieleah (Jessica Blank)
 [2011-05-19 04:53 UTC] jessieleah (Jessica Blank)
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
 [2012-01-02 06:23 UTC] doconnor (Daniel O'Connor)
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.
 [2012-01-02 06:29 UTC] doconnor (Daniel O'Connor)
-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?