Re: [jala] captcha broken?

Juerg Lehni <[email protected]> Fri, 8 Aug 2008 01:17:25 +0100
Newsgroups gmane.comp.java.helma.general
Message-ID <[email protected]>
Hello Anton,

Why not just rely on Helma's internal image saving mechanisms? They  =

would use whatever is available on a given system...

J=FCrg

On 4 Aug 2008, at 09:25, Anton Pirker wrote:

> Hi!
>
> I hope i also can ask jala questions in here.
>
> I just wanted to add a jala.Captcha() to my app and it did not work.
> First thing was, that the jcaptcha jar file was missing.
> I downloaded the latest version, changed the filename in Captcha.js  =

> and
> tried again. Again no luck.
>
> Captcha.js uses Packages.com.sun.image.codec.jpeg.JPEGCodec which  =

> seems
> not to be available in OpenJdk Java 1.6.0-b09.
>
> So i changed the code to use javax.imagei like this:
>
>    /**
>     * Render a new captcha image.
>     */
>    this.renderImage =3D function renderImage() {
>       var image =3D captcha.getImageChallenge();
>       var stream =3D new java.io.ByteArrayOutputStream();
>       javax.imageio.ImageIO.write(image, "jpg", stream);
>       res.contentType =3D "image/jpeg";
>       res.writeBinary(stream.toByteArray());
>       return;
>    };
>
>
> Now it works!
> Maybe some of the jala folks can add this changes to the repository?
>
> thanks,
> Anton
>
>
> -- =

> DI(FH) Anton Pirker
> Helma Freelancer
>
> http://www.ignaz.at
> http://shnitzl.org
>
> _______________________________________________
> Helma-user mailing list
> [email protected]
> http://helma.org/mailman/listinfo/helma-user