Skip to content

Bug: QR code generated with error correction level L, unreadable when printed small #659

Description

@anshul23102

Bug Report: QR Code Error Correction Level L Causes Scan Failures in Print

Description

DevCard QR codes are generated using the default error correction level L
(7% data recovery). When the QR code is printed in a small format (e.g., on
a business card at 3cm x 3cm) or displayed on a low-resolution screen, even
minor smudging, pixelation, or partial occlusion (a logo overlay, a coffee
stain) makes the code unscannable. Level M (15%) or Q (25%) provides
substantially better real-world reliability at minimal size cost.

Steps to Reproduce

  1. Generate a DevCard QR code for a user.
  2. Print it at business-card scale (approximately 3cm x 3cm).
  3. Attempt to scan the printed code under non-ideal lighting.
  4. Observe scan failures that do not occur on the digital version.

Root Cause

The QR generation library is called without specifying an error correction
level, defaulting to L.

Impact

The primary sharing mechanism (QR code at physical events, conferences, on
printed business cards) is unreliable, directly undermining the product's
core value proposition.

Proposed Fix

Set error correction to M or Q in the QR generation call:

import QRCode from "qrcode";

const qrDataUrl = await QRCode.toDataURL(devCardUrl, {
  errorCorrectionLevel: "M",  // Recovers up to 15% damage
  margin: 2,
  width: 256,
});

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions