Wayne,

You can do on-the-fly image creation/manipulation with objects, such as COM and 
JavaBean. I'm on Windows, and I use two COM based image manipulators to do 
similar work - although I've never developed a CAPTCHA routine.

Since you're on OSX, it's probably the case that you'll need to create a file 
on the OS and then serve it. The trick to keeping the folder clean is simple:

At the start of your script, clean up any old files: use the directory listing 
action to list the folder into an array, loop through it and use the file 
delete action to delete any files with a timestamp < yesterday. If you do this 
simple step each time you need a new CAPTCHA image, the whole process will 
maintain itself.

Although it's down my to-do list, I do intend to bring imagemagick out as a set 
of actions and/or tags in TeraScript. I think it's a nice tool to have in a 
scripting language.

Robert

-----Original Message-----
From: Wayne Irvine [mailto:[email protected]]
Sent: Monday, February 13, 2012 10:46 AM
To: [email protected]
Subject: Re: TeraScript-Talk: Imagemagick for CAPTCHA


On 13/02/2012, at 6:15 PM, William Conlon wrote:

> Google gives:  http://www.fmwconcepts.com/imagemagick/captcha/index.php

Thanks but I had already seen that. Infact that's what gave me the idea.

But if I go that route I am creating an image as a file and then showing the 
image through it's file path, then I would have to delete the file or be left 
with a load of files. Possible, but clumsy.

The way the PHP solutions I have seen work is that an img tag calls a PHP file 
which creates and returns the image on the fly:

<img src='createanimageonthefly.php'>

Two problems with that are that I can't get PHP working correctly on my servers 
and I'm not sure how to pass the string from Witango to PHP securely so I can 
compare the results.

So I am looking to create a Witango_cmd action that calls Imagemagick and 
stores the resultant image in a VAR or similar that can be accessed in the code 
that follows. I realise I'm probably not using the correct nomenclature but if 
I was, I would probably have a better idea how to do it and wouldn't have to 
ask this question.

Wayne Irvine

> On Feb 12, 2012, at 4:06 PM, Wayne Irvine wrote:
>
>> I have been fighting with various methods to implement CAPTCHA in some of my 
>> sites. Most involve external servers or PHP.
>>
>> I'm a Witango/Terascript guy and would like to keep it all inhouse.
>>
>> I use Terascript with Imagemagick to manipulate images. I could define a 
>> short string and send it to Imagemagick to munge it a bit but so far all my 
>> Imagemagick work has bee on files. What I'd really like is to return an 
>> element that could be referenced as an image and displayed to the user 
>> without creating temp directories and image files and having to clean up 
>> after.
>>
>> Does anyone have any clues (or better yet, step by step tutorials for the 
>> dummies ie me).
>>
>> Wayne Irvine
>>
>> ----------------------------------------
>>
>> To unsubscribe from this list, please send an email to 
>> [email protected] with "unsubscribe terascript-talk" in the body.
>>
>
>
>
>
> ----------------------------------------
>
> To unsubscribe from this list, please send an email to 
> [email protected] with "unsubscribe terascript-talk" in the body.
>



----------------------------------------

To unsubscribe from this list, please send an email to [email protected] 
with "unsubscribe terascript-talk" in the body.



----------------------------------------

To unsubscribe from this list, please send an email to [email protected] 
with "unsubscribe terascript-talk" in the body.

Reply via email to