question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting error correction level for QR code with function forBits has first bit reversed. So with numbers (0, 1, 2, 3) instead (L, M, Q, H) is (M, L, H, Q). Not big deal, but good to know.

BarcodeWriter writer = new BarcodeWriter();
writer.Options = new QrCodeEncodingOptions()
{
    Width = 100, 
    Height = 100, 
    ErrorCorrection = ErrorCorrectionLevel.forBits(codeQR.eccLevel)   //FIX: codeQR.eccLevel^1
};
writer.Format = BarcodeFormat.QR_CODE;
Bitmap QRcode = writer.Write(code);

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pzygielocommented, Aug 19, 2020

@Martin12350 - note - per wikipedia: dark is 0 on even rows and 1 on odd rows

And if i got it correctly then L=00,

So L = [dark, dark]T is not 00 I guess.

0reactions
srowencommented, Aug 21, 2020

No library will generate the bits 00 for L (or else it’s wrong). Source code might use constants 0-3 for L,M,H,Q internally, but that would be unrelated to its bit encoding.

To be clear, you will never be able to visually read off the information bits in a QR code. Everything is error-corrected, masked, or both. While EC level is encoded as 2 bits logically, there are no 2 modules on a QR code you can look at to read it as a human. In particular, EC+format info is 5 bits that’s actually encoded with BCH with an additional 15 bits of correction.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error correction feature | QRcode.com | DENSO WAVE
QR Code has error correction capability to restore data if the code is dirty or damaged. Four error correction levels are available for...
Read more >
QR Code Error Correction - QRStuff.com
There are 4 error correction levels used for QR codes, with each one adding different amounts of "backup" data depending on how much...
Read more >
QR Code Error Correction | qrd°by
Error correction helps, that a QR Code stays readable, even if some pixels are missing. You can choose between 4 different levels of...
Read more >
An overview of QR code error correction feature
Level L. This is the lowest level of error correction rate that a QR code can have. QR code software uses this level...
Read more >
QR error correction helps and hinders scanning
A QR code can use one of four error correction levels. Higher error correction forces denser codes, but allows scanning in more situations....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found