dubinc / dub

Open-source link management infrastructure. Loved by modern marketing teams like Vercel, Raycast, and Perplexity.
https://dub.co
GNU Affero General Public License v3.0
18.93k stars 2.05k forks source link

QR codes without margin are hard to scan #1732

Open zhengkyl opened 3 hours ago

zhengkyl commented 3 hours ago

I saw one of your QR codes in the wild, and after digging I noticed that your generators have margins disabled by default.

image

This is fine if the background is "white", but they won't work well on dark backgrounds. Easy to scan Slow/Difficult to scan
with without

image

The 3 large squares are used to "find" the QR code, and the edges need to stand out. The margin doesn't need to be large, 1 module wide is usually fine, 2 wide is safe. 4 wide is unnecessary. https://github.com/dubinc/dub/blob/c5db6dcc271fb539f2f8068dcc2600ebf5a82ff6/apps/web/lib/qr/constants.ts#L16

linear[bot] commented 3 hours ago

ENG-969 QR codes without margin are hard to scan