Reply to Re: Problem with image_text_color #000000

Re: Problem with image_text_color #000000 new!
by colin, 18 years, 2 months ago
Yes, you're right, there is a bug, actually two. It happens that imagecolorallocate() doesn't fill the image if it has been created in true colors. Then if the text is black, it becomes transparent as the background used for the merged text image is also black. A kind of double bug...

I will fix it in the next release. In the meantime, you can change the code as following.

Replace l.2478-2479:
$color = imagecolorallocate($filter, 0, 0, 0);
$text_color = imagecolorallocate($filter ,$red, $green, $blue);

With:
$color = imagecolorallocate($filter, 0, 0, ($blue == 0 ? 255 : 0));
imagefill($filter, 0, 0, $color);
$text_color = imagecolorallocate($filter ,$red, $green, $blue);
Reply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important