Hi,
I am using the library, but I cant decode an image (QRCode)with more 200 bytes.
The usual in a QRCode model 2 would be aprox. 4000 bytes alphanumeric right?
Images with less 200 bytes, I can see the result perfectly.
My source:
// -------------------------------------------------------
ui->setupUi(this);
QString result = "";
QZXing *imgDecoded = new QZXing();
imgDecoded->setDecoder(QZXing::DecoderFormat_QR_CODE);
QImage img = new QImage("C:/Users/Pedro/Desktop/QRSafeGenerator/images/qrcode.png");
result = imgDecoded->decodeImage(img);
ui->result->setText(result);
ui->image->setPixmap(QPixmap::fromImage(*img));
// -------------------------------------------------------
I added my image in attach.
Regards,
Pedro
Hello Pedro,
there is no restricition of the bytes that the QR code contains, though i have seen failures when it is needed to decode images with high resolution.
The image that you have attached is 1000x1000. I have successfully decoded it by down-scaling it to 512x512 for instance. This can be easily done by replacing the following line of your code:
result = imgDecoded->decodeImage(img);
to:
result = imgDecoded->decodeImage(img, 512, 512, true);
The reason of this "restriction" or the threshold over which failures begin to occur are still unclear to me, though i will try to investigate it when possible.
Please do try the above suggestion and reply the result so as to close the ticket if everything goes well.
Best regards.
The maximum acceptable resolution is 999x999.
Investigation will take place to locate the bottleneck.
Hello Nikolaos,
Thanks for the investigation.
I tried as you said and works fine!
You can close the ticket please.