jeromeetienne / jquery-qrcode

qrcode generation standalone (doesn't depend on external services)
http://blog.jetienne.com/blog/2011/04/07/jquery-qrcode/
MIT License
4.84k stars 2.5k forks source link

Incorporate 4-module "quiet zone" around codes #43

Closed jepler closed 7 months ago

jepler commented 11 years ago

According to wikipedia, QR codes should incorporate a 4-module "quiet zone", a region of white around all 4 sides of the QR code. This patch implements that as the default. Users can control this behavior by setting the margin option.

Note: if you're wary of changing the default then I'm happy to prepare a different pull request that causes margin to default to 0.

I prepared this patch after reading http://www.die-welt.net/2013/03/opera-standards-and-why-i-should-have-stayed-in-my-cave/ in part because of the apparent opera bug in the rendering of the final row of the table. If this final row is a quiet row then the opera bug would not affect the decodeability of the code.