PDA

View Full Version : CAPTCHA colors problem


contact399313
02-18-2010, 07:59 AM
Hi,

I have been using the Captcha feature of the WA CFSP just fine until I ran into this nagging problem which I'm describing below.
Does anyone have a clue what could be the problem and a solution ?

On host1, it works fine and on host2 it no longer works properly.

On host 1 with this setting for WA_Globals :
Setting 1 : ("standard" : white background and black text)
<?php
$WAGLOBAL_Captcha_Width = "200" ;
$WAGLOBAL_Captcha_Height = "40" ;
$WAGLOBAL_Captcha_Characters = "5" ;
$WAGLOBAL_Captcha_Font = "Fonts/MOM_T___.TTF" ;
$WAGLOBAL_Captcha_BG = "FFFFFF" ;
$WAGLOBAL_Captcha_Noise = "000000" ;
$WAGLOBAL_Captcha_Text = "000000" ;
$WAGLOBAL_Captcha_BG_transparent = "0" ;
$WAGLOBAL_Email_Server = "" ;
$WAGLOBAL_Contact_Email_Subject = "Online Contact Form Response" ;
$WAGLOBAL_Contact_Email_To = "email@yourdomain.com" ;
$WAGLOBAL_Contact_Email_CC = "" ;
$WAGLOBAL_Contact_Email_BCC = "" ;
?>

The result shown in attached crypto1.jpg

With this setting of WA_Globals
Setting 2 : (blue background and deep yellow text)

<?php
$WAGLOBAL_Captcha_Width = "200" ;
$WAGLOBAL_Captcha_Height = "40" ;
$WAGLOBAL_Captcha_Characters = "5" ;
$WAGLOBAL_Captcha_Font = "Fonts/MOM_T___.TTF" ;
$WAGLOBAL_Captcha_BG = "78B9F6" ;
$WAGLOBAL_Captcha_Noise = "000000" ;
$WAGLOBAL_Captcha_Text = "FF9933" ;
$WAGLOBAL_Captcha_BG_transparent = "0" ;
$WAGLOBAL_Email_Server = "" ;
$WAGLOBAL_Contact_Email_Subject = "Online Contact Form Response" ;
$WAGLOBAL_Contact_Email_To = "email@yourdomain.com" ;
$WAGLOBAL_Contact_Email_CC = "" ;
$WAGLOBAL_Contact_Email_BCC = "" ;
?>

The result shown in crypto2.jpg

Up to now everything is fine.

On host 2 :
With Setting 1 : result shown in crypto3.jpg
With Setting 2 : result shown in crypto4.jpg

Colors don't work properly anymore !
With setting1, black text appears light yellow !
With setting2, deep yellow text is not visible on blue background !

I've tried various settings on host 2 to "turn around" that difficulty but to no avail.
The best I get so far is crypto3.jpg which is hardly readable !

I have to add that both hosts have ofcourse their gd enabled and that the only difference between the two is the following :
Host1 : FreeType Linkage : with freetype
Host2 : FreeType Linkage : with TTF Library

So I would have thought that captcha was more likely to work under host2 than host1 and it's just the opposite !
I can't figure it out !

Thank you very much in advance for any suggestion.

Dan

Jason Byrnes
02-18-2010, 12:20 PM
You might try replacing:

imagecreatetruecolor

with:

imagecreate

in the file: WAVT_CaptchaSecurityImages.php

I think it only appears once on line 89

contact399313
02-22-2010, 02:12 AM
Hi,

Thanks for redirecting me to your solution.
It works perfectly now, regardless of the server !
Incidentally, I had seen your post later that day and tested it right away. This shows once more one should really search thorougly for an answer before posting !

I would just like to say I'm amazed that such a product can still be on sale with such a bug still in the code, years later ! Or maybe I'm missing something...? Maybe there was a "fix" announced sometime somwhere...?

Thanks anyway ! I would never have guessed !

Regards

Dan

Ray Borduin
02-22-2010, 06:12 AM
To be fair it is actually a bug on your php server, and a work-around available for the code.

Most people do not have to make this change since it works on most php server installations.