ID: 41666 Updated by: [EMAIL PROTECTED] Reported By: cyberline at techno4ever dot net -Status: Open +Status: Feedback Bug Type: GD related Operating System: Debian 3.1 PHP Version: 5.2.3 Assigned To: pajoye New Comment:
"I don't mean the transparent background! My problem is the text." As long as you have no alpha channel, there is no alpha either involved in the text. The text itself works pretty well here. Your problem looks more like a hinting problem which depends on the freetype version, settings or options. Can you show me a phpinfo and tell me which freetype version you use and on which system. Previous Comments: ------------------------------------------------------------------------ [2007-06-12 12:54:03] cyberline at techno4ever dot net I don't mean the transparent background! My problem is the text. Compare: http://cyberline.ath.cx/phpbug/nok.php (PHP 5.2.1) with http://web1.server02.quadrat4.de/phpbug/nok.php (PHP 5.2.3) Both same Configure. ------------------------------------------------------------------------ [2007-06-12 12:05:03] [EMAIL PROTECTED] "So it is not a bug that in 5.2.1 the alpha was enabled by default " I don't have a 5.2.1 to test. The alpha channel is now preserved (the background, the white area around the logo). nok.php is black because you don't save the alpha channel. I think this bug is not a bug. I close (not a bug > bogus) it now. Please reopen it if you consider that it is not working correctly in 5.2.3 or using snapshot. ------------------------------------------------------------------------ [2007-06-12 11:54:58] cyberline at techno4ever dot net Now the 5.2.1 working Sample (nok.php) looks fine with imagesavealpha, but take a look at the ok.php with imagealphablending($image, 0); So it is not a bug that in 5.2.1 the alpha was enabled by default ? ------------------------------------------------------------------------ [2007-06-12 11:45:19] [EMAIL PROTECTED] Ok, I understand what you mean now. There is two things. Per default gd does not save the alpha information, you have to enable this mode using: imagesavealpha($image, true); The second problem is the blending mode while copying/resizing the embed image. You have to disable the blending operation. Try: <?php $image = imagecreatetruecolor(222, 189); $embed = imagecreatefrompng($logofile); $white = imagecolorallocate($image, 255, 255, 255); imagealphablending($image, 0); imagecopyresized($image, $embed, 0, 0, 0, 0, 222, 189, imagesx($embed), imagesy($embed)); imagettftext($image, 12, 0, 5, 15, $white, $font, $text); imagesavealpha($image, true); imagepng($image, $destfile); imagedestroy($image); ------------------------------------------------------------------------ [2007-06-12 11:11:44] cyberline at techno4ever dot net The fontfile: http://web1.server02.quadrat4.de/federation.ttf The logo: http://web1.server02.quadrat4.de/logo.png (I've tested other transparent PNG's with similar results) Further i've added a sample text with ./arial.ttf ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/41666 -- Edit this bug report at http://bugs.php.net/?id=41666&edit=1