Zubrag.com
December 17, 2017, 07:52:30 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: CAPTCHA script, image does not display?  (Read 17601 times)
recoding
Global Moderator
Jr. Member
*****
Posts: 71


WWW
« 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

Logged

zubrag
Administrator
Hero Member
*****
Posts: 785


WWW
« Reply #1 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. 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

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);
Logged
k3n_n3th
Newbie
*
Posts: 1


« Reply #2 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!
Logged
aliceraNz
Newbie
*
Posts: 1


« Reply #3 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
Logged
zubrag
Administrator
Hero Member
*****
Posts: 785


WWW
« Reply #4 on: June 22, 2015, 01:12:43 AM »

Hi. You mean you followed "One more solution" and converted TTF to gdf?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC