How to create an Captcha with TclMagick?



Hi,

to protect my self-made board against Spambots a captcha is necessary.
So i have to create one using TclMagick.

My current try on apache 1. Webserver (with installed rivet):

<?
package require TclMagick
set wand [magick create wand]
set draw [magick create drawing]
set rpx [magick create pixel red]
$rpx color red
$draw SetStrokeColor red
$draw SetFillColor red
$draw color 1 1 point
$wand SetSize 100 30
$wand DrawImage $draw
?>

This small script doesn't work and i can't understand the syntax of
TclMagick?! :-\

I hope someone could help me with this Problem, all i want is:

A small Captcha graphic (any resolution but not to big!) with 5
radomly selected chars (a-z, A-Z, 0-9). The chars should also have an
randomly selected rotation between 0 and 30 degrees.

The script above was my try to create only a small image to test
TclMagick, but it ends with the following error:

Wand contains no images `MagickWand-3'
while executing
"$wand DrawImage $draw"
(in namespace eval "::request" script line 13)
invoked from within
"namespace eval request {
puts -nonewline ""

I hope someone could help me with this Problem!

cheers
Dominic

.



Relevant Pages

  • Re: How to create an Captcha with TclMagick?
    ... How to create an Captcha with TclMagick? ... set wand ... set draw [magick create drawing] ... $drw SetStrokeColor $clr ...
    (comp.lang.tcl)
  • Does TclMagick allow to extend the canvas?
    ... thumbnail write $thumbFileName -background white -format jpeg; ... Does someone know how to do this with TclMagick? ... set wand [magick create wand]; ...
    (comp.lang.tcl)
  • Re: Does TclMagick allow to extend the canvas?
    ... Creating 100 thumbnails of photos took on our not-so- ... Jeff advised me to try out TclMagick, so I did and it looks good! ... thumbnail write $thumbFileName -background white -format jpeg; ... set wand; ...
    (comp.lang.tcl)
  • Re: Does TclMagick allow to extend the canvas?
    ... thumbnail write $thumbFileName -background white -format jpeg; ... Does someone know how to do this with TclMagick? ... set wand; ... lot of options but just plain "overlay" looks promising. ...
    (comp.lang.tcl)