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

Bug #10775 when color = #000000 antialias is always true
Submitted: 2007-04-19 11:12 UTC
From: dickvisser Assigned: stoyan
Status: Closed Package: Image_Text (version 0.6.0beta)
PHP Version: 5.1.6 OS: Ubuntu 6.10
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 34 - 24 = ?

 
 [2007-04-19 11:12 UTC] dickvisser (Dick Visser)
Description: ------------ When creating my picture with color #000000 (ie. black), then antialiase is always true. Test script: --------------- Create pic with this options: $colors = array( 0 => '#000000', 1 => '#e8ce7a', 2 => '#7ae8ad' ); $options = array( 'canvas' => array('width'=> 300,'height'=> 25), // Generate a new image 600x600 pixel 'cx' => 150, // Set center to the middle of the canvas 'cy' => 10, 'width' => 300, // Set text box size 'height' => 20, 'line_spacing' => 1, // Normal linespacing 'angle' => 0, // Text rotated by 45 'color' => $colors, // Predefined colors 'background_color' => '#ffffff', //red background 'max_lines' => 1, // Maximum lines to render 'min_font_size' => 5, // Minimal/Maximal font size (for automeasurize) 'max_font_size' => 9, 'font_path' => '/usr/local/share/php/font', // Settings for the font file 'font_file' => 'verdana.ttf', 'antialias' => false, // Antialiase font rendering 'halign' => IMAGE_TEXT_ALIGN_LEFT, // Alignment to the right and middle 'valign' => IMAGE_TEXT_ALIGN_MIDDLE ); Expected result: ---------------- No antialiasing in picture Actual result: -------------- Antialiasing in picture. If I change the first color from #000000 to anything else, the anti aliasing goes away.

Comments

 [2007-04-24 03:45 UTC] stoyan (Stoyan Stefanov)
This bug has been fixed in CVS. 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. Thanks Dick for reporting the issue! It's now fixed in CVS. The problem was with how http://php.com/imagettftext disables anti-aliasing by assigning a negative value to the color index. Since black is index 0, multiplying it by -1 doesn't help. Best regards and thanks again, Stoyan