Click here to get back home

Need to test this Captcha on somebody's Perl

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Need to test this Captcha on somebody's Perl Daniel Kaplan 12-09-2005
Get Chitika Premium
Posted by Daniel Kaplan on December 9, 2005, 1:52 pm
Please log in for more thread options


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^&nbsp;<p><img border = "0" src="../cap_output/^ . $md5sum .
qq^.png">^;

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;
}




Posted by John Bokma on December 9, 2005, 9:19 pm
Please log in for more thread options



> 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 :-)



Posted by Daniel Kaplan on December 9, 2005, 6:11 pm
Please log in for more thread options


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




Similar ThreadsPosted
Captcha Modules August 15, 2005, 5:35 pm
Authen::Captcha toggle question May 16, 2005, 4:29 pm
Authen::Captcha toggle question March 21, 2005, 5:34 am
Problem with Authen::Captcha has frozen my development December 10, 2005, 11:30 am
"Devel::DProf" on a PERL script uses "Test::More" December 5, 2005, 5:36 pm
make test failing on Berkeley DB 4.5/perl 5.8 (and 5.6) on BSD6/AMD64 November 29, 2006, 4:44 pm
OT: test October 24, 2008, 12:43 pm
Test::Pod problems March 3, 2007, 1:04 am
test fails May 10, 2008, 1:17 pm
Asking questions in 'make test' July 27, 2004, 12:55 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap