Skip to content
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

Please expose the error tolerance for QR codes #1

Open
CWBudde opened this issue Dec 29, 2013 · 2 comments
Open

Please expose the error tolerance for QR codes #1

CWBudde opened this issue Dec 29, 2013 · 2 comments

Comments

@CWBudde
Copy link

CWBudde commented Dec 29, 2013

Currently we're using the Google API to generate QR codes. It offers an error correction level of 'L', 'M', 'Q' and 'H' (according to the specs, see https://en.wikipedia.org/wiki/QR_code#Error_correction).

With this library an TErrorCorrectionLevel class is available, that probably control this option. However, it is not exposed by GenerateQRCode(..), which is used by the TDelphiZXingQRCode class. The value is hard-coded to 1 ("Level.FBits := 1;").

I guess adding a variable parameter should do the trick:

function GenerateQRCode(const Input: WideString; EncodeOptions: Integer; ErrorCorrectionBits: Integer = 1): T2DBooleanArray;

[...]

Level.FBits := ErrorCorrectionBits;

Then, just add a property for error correction bits that defaults to 1 in the TDelphiZXingQRCode class.

From what I have read I'm not sure if (and what) the bits setting corresponds to the predefined error levels. In the original ZXing library some information can be found here:

http://code.google.com/p/zxing/source/browse/trunk/core/src/main/java/com/google/zxing/qrcode/decoder/ErrorCorrectionLevel.java

I hope this helps to get this added to this library.

@This77
Copy link

This77 commented May 30, 2017

Even if they did expose the ErrorCorrectionLevel (which I did just to test):
It seems that QRCodes generated by this unit with Level.Bits other = 1 can not be interpreted by any QRScanner.

@ajasja
Copy link

ajasja commented Sep 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants