[ic] [captcha] won't generate image

Grant emailgrant at gmail.com
Sat Nov 3 11:26:49 EST 2007


> >I've studied the docs in the captcha tag's source but I can't get it
> >to generate an image on the server.  I'm not sure which of these
> >should generate the image but I've tried both:
> >
> >[captcha function=code image-path=/full/path/captcha]
> >
> >[captcha function=image name-only=1 relative=1 image-path=/full/path/captcha]
> >
> >I have the following permissions on the captcha directory:
> >
> >drwxrwxr-x interch users
> >
> >I've installed the Authen-Captcha and GD perl modules and added the
> >following to interchange.cfg:
> >
> >Require module Authen::Captcha
> >Require module GD
> >
> >I've restarted IC and apache and there is nothing in error.log or
> >error_log.  Can anyone tell me what I'm doing wrong?
>
> Put the following code on a test page. It works for me.
>
>   [if cgi mv_captcha_guess]
>     [tmp good][captcha check][/tmp]
>     [if scratch good]
>       You guessed right!
>     [else]
>       Sorry, try again.
>     [/else]
>     [/if]
>     <br>
>   [/if]
>
>   [captcha length=5 function=image]
>
>   <form action="[process href="@@MV_PAGE@@"]">
>   <input type=text name=mv_captcha_guess size value="">
>   <input type=submit value="Guess">
>   </form>
>
>   [error auto=1]
>
>
> Of course you will need properly installed modules:
> - GD (including the GD perl modules)
> - Digest::MD5
> - Authen::Captcha
>
> There is no need for any Require in interchange.cfg
> as the required module Authen::Captcha is loaded
> in the global captcha tag.

Everything works fine without NoAbsolute set, but when it is set, the
image is not generated.  Here is the pertinent bit of code from
captcha.coretag:

my $imgdir = $opt->{image_location} || $::Variable->{CAPTCHA_IMAGE_LOCATION};

unless ($imgdir ) {
if(! $Global::NoAbsolute and $::Variable->{DOCROOT}) {
$imgdir = "$::Variable->{DOCROOT}$::Variable->{IMAGE_DIR}/$subdir";
}
else {
$imgdir = "images/$subdir";
}
}

My DOCROOT and IMAGE_DIR are set properly and I tried setting the
different CAPTCHA catalogs variables but the image is still not
generated using [captcha image] unless NoAbsolute is unset.

Also, these docs say IMAGE_DIR is obsolete but it is used by captcha.coretag:

http://www.icdevgroup.org/docs/vars/IMAGE_DIR.html

- Grant


More information about the interchange-users mailing list