Zubrag.com :: Forum

zubrag.com => Anti Spam Image Generator => Topic started by: recoding on April 15, 2007, 01:28:09 PM



Title: CAPTCHA script, image does not display?
Post by: recoding on April 15, 2007, 01:28:09 PM
For some reason i don't get anything come up?
i changed it to .jpg, to see if that would fix it, but to no luck, as it just shows the location of the image displayed (if i go directly there)
Currently, nothing comes up. directly or in a page, I'm not entirely sure what i am doing wrong, i have uploaded the arial.ttf from my Computer to the server, and tried renaming it in the script to arial.ttf but still nothing comes up =[

any help on this would be greatly appreciated


Title: Re: CAPTCHA script, image does not display?
Post by: zubrag on April 16, 2007, 10:46:10 AM
There is no FreeType support.  If you want to know if your php has FreeType support save following as phpinfo.php on your server, and open in the browser. Is there a line saying FreeType Support enabled or FreeType Version mentioned?
<?php  echo phpinfo(); ?>

Following would be a workaround if FreeType support is not enabled.

Replace
imagettftext($image, $font_size, 0, 7,17, $text_color, $font , $code)

with
imagestring ($image, $font_size, 5, 5,  $code, $text_color);

Note: you can set $font_size to 1, 2, 3, 4, 5 in the above string to change font size.


One more solution proposed by recoding (http://www.recoding.net). We'll implement this in next version. Thanks for your help Dan!

1. Downloaded Windows program to convert Windows fonts to PHP fonts http://www.wedwick.com/wftopf.exe (http://www.wedwick.com/wftopf.exe)

2. Converted my arial.ttf, to PHP

3. Updated the code, so that:

Code:
$font = 'arial';

Became

Code:
$font = imageloadfont("arial.gdf");

And lower in the code
Code:
imagestring ($image, $font_size, 5, 5,  $code, $text_color);

became

Code:
imagestring ($image, $font, 5, 5,  $code, $text_color);


Title: Re: CAPTCHA script, image does not display?
Post by: k3n_n3th on September 08, 2008, 10:04:17 PM
Hi! Do I really have to patch a gd for php 4.2.3 to make this work? Your rquirement says that It can work on php 4.0.6. I found that patching that gd got some issues. All of my gd support is also been enabled including the free type support. Please help me make this work. I really appreciate any help. Thank you!


Title: Re: CAPTCHA script, image does not display?
Post by: aliceraNz on June 20, 2015, 11:06:20 AM
There is no FreeType support.  If you want to know if your php has FreeType support save following as phpinfo.php on your server, and open in the browser. Is there a line saying FreeType Support enabled or FreeType Version mentioned?
<?php  echo phpinfo(); ?>
.............................

imagestring ($image, $font, 5, 5,  $code, $text_color);

I've just done with your instruction and it shows CAPTCHA but no letters found or seen but crowded black spot with white space ...
how can I solve this, please ..
thanks for help


Title: Re: CAPTCHA script, image does not display?
Post by: zubrag on June 22, 2015, 01:12:43 AM
Hi. You mean you followed "One more solution" and converted TTF to gdf?