From: pm5884 at email dot si Operating system: WinXP PHP version: 4.4.1 PHP Bug Type: GD related Bug description: ImageTTFtext output Black&White image error
Description: ------------ A interesting problem with imagettftest function, it can't output 2 color (black & white - 1 BitsPerPixel) images. It always switches to at least 16 color's (4 BitsPerPixel). I need 2 color output, how can I get it??? Reproduce code: --------------- <? $image = ImageCreate(100,30); $background_color = ImageColorAllocate($image, 255, 255, 255); $text_color = ImageColorAllocate($image, 0, 0, 0); $ttf_font = './font/Arial.ttf'; $text = 'test'; echo imagecolorstotal($image)."<br>"; ImageTtfText($image ,10 ,0 ,23 ,23 ,$text_color, $ttf_font, $text); echo imagecolorstotal($image); ImagePNG($image,"./file.png"); ImageDestroy($image); ?> Expected result: ---------------- BLACK & WHITE image Actual result: -------------- 16 clor image -- Edit bug report at http://bugs.php.net/?id=35808&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35808&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35808&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35808&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=35808&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=35808&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=35808&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=35808&r=needscript Try newer version: http://bugs.php.net/fix.php?id=35808&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=35808&r=support Expected behavior: http://bugs.php.net/fix.php?id=35808&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=35808&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=35808&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=35808&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35808&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=35808&r=dst IIS Stability: http://bugs.php.net/fix.php?id=35808&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=35808&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=35808&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=35808&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=35808&r=mysqlcfg