[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Captcha for Web Application opinion ?


Hello,

In the end I was able to code the Captcha generator using CAIRO component fro Web Application.
It’s not perfect but it does the job as expected.

The only part I don’t like it the fact CAIRO library allow only to save the result of an Image Object to a file and there is no way (as I saw) to retrieve the content of the Image (binary octets) directly, in a way to convert the content as Base64, to be included into an HTML page.

Like that, no need to create temporary files, that will need to be deleted at a moment, for clean up.

If Benoit or someone know if it’s possible to convert an Image object created by Cairo to a Base64 string, it will be really great.


Attachment: WebCaptchaGen-0.0.1.tar.gz
Description: GNU Zip compressed data




Olivier

Le 3 nov. 2025 à 10:35, Linus <olivier.cruilles@xxxxxxxx> a écrit :

Hello all,

For a Web Application built with gb.web.gui component I need a Captcha image generator.
After few search I found services on the Web offering that or by Python script on lInux too.

In the end I realize that there is all the necessary to code it in Gambas.

So, I created a simple Captcha generator in Gambas Desktop application, as training.

I have attached the little project into the email

Now, my question is what is the best/simple way to create the same thing but with the gb.web.gui drawing tools ?

In effect, for Gambas Desktop Application we have the choice:

- ‘Draw’ functionalities
- ‘Paint’ functionalities
- ‘Cairo’ functionalities

With all of those libraries (Draw, Paint, Cairo), it’s easy to draw inside an Object ‘Image’ or ‘Picture’ without saving the result into a file, like I did in my little project. I tried to use ‘Cairo’ library in the Web Application, but it's way more complicate to understand and use.

So, with the gb.web.gui component, the ‘Paint’ functionalities are only possible into a WebDrawingArea and not into an Object ‘Image’ or ‘Picture’.

My question now is more, what could be the best way to reproduce the same Captcha Image like I did in my project, but using the gb.web.gui component ?

If someone has an idea of how to proceed, it will be really appreciate.

Thank you

Olivier

Attachment: TestCaptchaGen-0.0.1.tar.gz
Description: GNU Zip compressed data






References:
Captcha for Web Application opinion ?Linus <olivier.cruilles@xxxxxxxx>