Need to test this Captcha on somebody"s Perl

Need to test this Captcha on somebody"s Perl

am 09.12.2005 19:52:46 von DFS

Ok, here it goes. My server with Perl is kept and maintained at one of
those ISP warehouses. The truth is I am no SA, so couldn't build a Perl
setup.

I started using Authen::Captcha and needed more so added
GD::SecurityImage::AC. But what happened was that whenever I try to use a
TTF font, no text appears, and $@ contains

"libgd was not built with FreeType font support "

My server people said they did the rebuild twice "The first time I used the
source RPM... the second time I
used the latest source provided by GD's website" and that settles it on
their end.

As for the font path or file itself being good, we're using the same path
and file on a simple PHP file, so that's all good.

Here is what I was wondering. Does anyone have a Perl system setup that can
run the script below? It is very short, and if you alternate between TTF &
Normal (lines 38 & 39) you either get a full captcha image or one with no
text and an error.

I have to try something to find out what is wrong here.

Thanks.


#!/usr/bin/perl

use warnings;
use strict;
use CGI;
use GD::SecurityImage::AC;
no warnings 'uninitialized';

my $q = new CGI;

my ($md5sum) = MakeCaptcha();


my $errr = $@;

my $out = $errr;

$out .= qq^ 

^;

print $q->header();
print $out;
exit 0;

sub MakeCaptcha
{

my $number_of_characters = 4;
my $captcha = Authen::Captcha->new();
$captcha->gdsi(new => {
lines => 2,
width => 132,
height => 57,
scramble => 0,
angle => 45,
font => "/usr/local/fonts/comic.ttf",
ptsize => 12,
},
create=> [ttf=>'defualt', '#3333AA', '#AA3333'],
# create=> [normal=>'defualt', '#3333AA', '#AA3333'],
);

$captcha->data_folder('../cap_data');
$captcha->output_folder('../cap_output');
$captcha->debug(2);

my ($md5sum,$chars) = $captcha->generate_code( $number_of_characters );


return $md5sum;
}

Re: Need to test this Captcha on somebody"s Perl

am 09.12.2005 22:19:28 von John Bokma

"Daniel Kaplan" wrote:

> create=> [ttf=>'defualt', '#3333AA', '#AA3333'],

^^^^^^^^


Don't know if this fixes things, but it might be causing a problem.


--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
I ploink googlegroups.com :-)

Re: Need to test this Captcha on somebody"s Perl

am 10.12.2005 00:11:15 von DFS

"John Bokma" wrote in message
news:Xns97279BE2742E7castleamber@130.133.1.4...
> "Daniel Kaplan" wrote:
>
>> create=> [ttf=>'defualt', '#3333AA', '#AA3333'],
>
> ^^^^^^^^
>
thanks anyway but it turned out i was right, and my isp was wrong, a rarity!
took them three times to recompile the GD module and finally get it right.

for anyone in my situation, where you only know a bit of Perl and your ISP
is just poo-pooing you am including a script i found online. it's a GD
tester and was part of a download provided by www.hamweather.com at
http://support.hamweather.com/dload.php?action=file&file_id= 105.

in the zip download there is a file called gdtest.cgi and that was enough to
convince my ISP to look again at their end. whew!

thanks