#30739 [Asn->Csd]: Writing on a Black BG
| From: | pajoye@php.net | Date: | Wed, 17 Nov 2004 17:18:21 +0000 |
| Subject: | #30739 [Asn->Csd]: Writing on a Black BG | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-69181@lists.php.net to get a copy of this message | ||
ID: 30739
Updated by: pajoye@php.net
Reported By: nate at highsocietyfreeride dot com
-Status: Assigned
+Status: Closed
Bug Type: GD related
Operating System: apache?
PHP Version: 4.3.10-dev
Assigned To: pajoye
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Hello,
The bug was due to imagefill, it did not set back the alphablending to
true. This is somehow required for font rendering with antialiasing.
Btw, with true color images you do not need to fill the background with
black, the default is black (0).
a temporary fix is to call imagealphablending(true); after imagefill.
Bug is fixed in cvs.
Thanks for this report,
--Pierre
Previous Comments:
------------------------------------------------------------------------
[2004-11-10 09:39:15] tony2001@php.net
Confirmed with 4.3.10-dev, not reproducible with 5.0.x & 5.1.x branch.
------------------------------------------------------------------------
[2004-11-10 00:05:41] nate at highsocietyfreeride dot com
Description:
------------
First off, I'm not sure what verison of PHP our servers use. My
hosting service is IpowerWeb.com
When I use imagettftext to write onto an image, it works fine, unless I
allocate the color of 0,0,0. Even 1,1,1 works just fine.
When I write to a complete black background the text shows up as
rectangles, not the actual letters. The rectangles look like bounding
boxes because they take the size of the actual letter its trying to
print.
Reproduce code:
---------------
<?php
$im_header = imagecreatetruecolor( 440, 83);
$white = imagecolorallocate($im_header, 255, 255, 255);
$black = imagecolorallocate($im_header, 0, 0, 0);
imagefill($im_header,0,0,$black);
imagecolortransparent($im_header, $black);
imagettftext($im_header, 32, 0, 0, 42, $white, "fonts/verdana.TTF",
"test");
imagejpeg($im_header);
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30739&edit=1