-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binary data. #10
base: master
Are you sure you want to change the base?
Binary data. #10
Conversation
This does not currently work. Not even [zxing-cpp](https://github.com/glassechidna/zxing-cpp/) can handle this: $ zxing --more --verbose tests/fixtures/amen-02.png Hybrid binarizer failed: zxing::ReaderException: No code detected Global binarizer failed: zxing::ReaderException: No code detected so before this can be committed, zxing-cpp needs to be repaired, or we need to do #7 first. The test file is from https://sampleswap.org//samples-ghost/DRUM%20LOOPS%20and%20BREAKS/161%20to%20180%20bpm/128[kb]161_amenvar3.aif.mp3 and it should be public domain, plus it is an extremely short sample in any case which should make it fall under fair use no matter what.
This depends on glassechidna/zxing-cpp#80 getting merged. Then, zxinglight needs to not use |
I **changed the API** for this: now it outputs bytes instead of strs. This probably needs to be thought through further, but, on my system with glassechidna/zxing-cpp#80 applied underneath, it makes my new test with the embedded null pass.
I've written a patch but it should be considered a first draft. I'd like some feedback on the shape of the API (re: #4 (comment)): should it have two output variables side by side, one for text and one for binary, like nu-book's and jsQR? Should it only be one? 🥳EDIT🥳: wtf? how did that test pass? @glassechidna hasn't merged my PR yet. 🤔 I think it would be nicest and most pythonic if it could only be one. The easiest flow, I think, is if you scan a textual code you get The really tricky thing is that QR codes can mix character sets inline, so the decoder must pay attention as it runs and either canonicalize everything into a master character set (in practice, Unicode) or keep the chunks in separate pieces with their character sets marked. jsQR does both: it puts everything into JS strings (which are..UCS-2, I think?), transcoding them from UTF-8, but if that fails it leaves a blank in the |
The QR spec is supposed to support binary data, but there are this does not currently work. Not even zxing-cpp can handle this:
$ zxing --more --verbose tests/fixtures/amen-02.png
Hybrid binarizer failed: zxing::ReaderException: No code detected
Global binarizer failed: zxing::ReaderException: No code detected
so before this can be committed, zxing-cpp needs to be repaired,
or we need to do #7 first.
The test file is from https://sampleswap.org//samples-ghost/DRUM%20LOOPS%20and%20BREAKS/161%20to%20180%20bpm/128[kb]161_amenvar3.aif.mp3
and it should be public domain, plus it is an extremely short sample
in any case which should make it fall under fair use no matter what.