Bug 449742 - Doesn't recognize QR codes
Summary: Doesn't recognize QR codes
Status: CONFIRMED
Alias: None
Product: kodaskanna
Classification: Applications
Component: general (show other bugs)
Version: 0.1.0
Platform: Other FreeBSD
: NOR normal
Target Milestone: ---
Assignee: Friedrich W. H. Kossebau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-07 12:08 UTC by groot
Modified: 2024-12-04 21:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
black QR code with round eyes (27.64 KB, image/png)
2022-02-07 12:08 UTC, groot
Details
black w/ squares (19.10 KB, image/png)
2022-02-07 12:09 UTC, groot
Details
blue w/ round eyes (23.13 KB, image/png)
2022-02-07 12:09 UTC, groot
Details
blue w/ squares (20.49 KB, image/png)
2022-02-07 12:09 UTC, groot
Details
qr-black-alt.png (346 bytes, image/png)
2022-02-07 13:30 UTC, groot
Details

Note You need to log in before you can comment on or make changes to this bug.
Description groot 2022-02-07 12:08:29 UTC
Created attachment 146388 [details]
black QR code with round eyes

Find attached 4 QR codes -- blue, black, rounded and sharp edges. These all come from qrcode-tiger.com, and all contain the URL "http://example.com" and all are recognized when displayed on-screen, by my phone's camera. None of them are recognized by kodaskanna.
Comment 1 groot 2022-02-07 12:09:00 UTC
Created attachment 146389 [details]
black w/ squares
Comment 2 groot 2022-02-07 12:09:21 UTC
Created attachment 146390 [details]
blue w/ round eyes
Comment 3 groot 2022-02-07 12:09:53 UTC
Created attachment 146391 [details]
blue w/ squares
Comment 4 Friedrich W. H. Kossebau 2022-02-07 12:50:51 UTC
Thanks for the samples, could reproduce on openSUSE TW.

Some other ZXing-based decoder had no issues on a quick try, so the guess for now is kodaskanna needs improvements in who it uses XZing, put on my todo list for next release.
Comment 5 groot 2022-02-07 13:30:06 UTC
I thought -- remember from some earlier testing -- that black pixels were OK, but blue was not. I can't get it to work with any of these images now, though. As an example, `kodaskanna qr-black-sharp.png` prints no output, the display is "could not scan code in the image". This is with 

zxing-cpp-1.2.0                ZXing C++ Library for QR code recognition

FWIW, qtqr (just some random python-and-qt tool I found for QR-encoding and decoding) does decode all four of these codes, and produces the attached qr-black-alt.png for the same URL -- and **that** is one that kodaskanna can deal with. One out of five ain't bad.
Comment 6 groot 2022-02-07 13:30:26 UTC
Created attachment 146392 [details]
qr-black-alt.png
Comment 7 Friedrich W. H. Kossebau 2024-12-04 21:17:35 UTC
Small update on current state, after having ported to Qt6 and using newer zxing-cpp:

Trying again all samples right now using current zxing-cpp 2.2.1 of openSUSE TW, all the provided samples besides one, the black QR code with round eyes, can be parsed now, other than before.

There as no change in kodaskanna's parameters passed to zxing, so something internally might have changed in that lib? Or perhaps the raw QImage data passed into the methods have changed somewhere? No further investigation yet done besides pure retrying the images.

The ZXing-based decoder I mentioned before where all scanning worked was sailfishos-barcode. I uploaded the image to my phone and scanned it directly from the image gallery. I could not yet see where that app uses different args so that things work, guess I have to play with the actual code when I have more time.

So this bug still needs more work.