Get QString data from the QPixmap
-
No, I want extract it to compare with user input from
QLineEdittext function.So for example, the captcha code: ABCD.
User input: ABCD.
So I can compare it as text or some hash to validate if it matches.qDebug() << data.bits(); // it returns 0xa1ff200 -
QImage::bitsgives you the starting address of the raw image data.Where do you get that gif from ?
-
QImage::bitsgives you the starting address of the raw image data.Where do you get that gif from ?
I parse it from my website.
Here is the some
PHPcode:$_SESSION["image"] = implode('', $cod); // gets code captcha header("Content-type: image/gif"); //loads the captcha image imagegif($src); imagedestroy($src);I need this -
$_SESSION["image"] = implode('', $cod);to be parsed so I can compare later with user input.
I use$_SESSION["image"]to validate captcha code on the website. So I need to parse it to the application but since the header content type is the image, I can't access the captcha code.Another solution is to use this project from GitHub:
QtCaptchaAlso I can port
PHPcaptcha generation to theC++but it will take long. -
What are you using to generate that captcha ?
-
-
So basically, you want to decipher the captcha image you generate client side to check whether the use input is correct ?
-
So basically, you want to decipher the captcha image you generate client side to check whether the use input is correct ?
Yes.
-
You do realise that the goal of the captcha is to make it really difficult for computer to deduce what's on it ?
-
You do realise that the goal of the captcha is to make it really difficult for computer to deduce what's on it ?
Yes, I know it. I think I have the idea how to decipher it. I will try it and reply.
-
You do realise that the goal of the captcha is to make it really difficult for computer to deduce what's on it ?
So my solution is:
I have stored
$_SESSION["image"]value to the txt file witch is thecaptchacode. Then I read this file and now get the value to compare with the user input. Also I'm thinking about putting it to the database or restrict access to the file. -
By the way, why do it on the client side ?
