Table QR codes need Math.floor on width and height values to avoid invalid codes #42

wants to merge 1 commit into


None yet
2 participants

Table-based QR codes weren't being calculated with Math.floor to round down their widths and heights, and were frequently being drawn as invalid, "squeezed" QR codes. this fix uses this. This rounds those down as well as the full qr code itself to avoid other issues. One problem is that this approach doesn't necessarily spit back a QR code of the exact width and height that you asked for, but it at least is always valid, and since it rounds down, it'll avoid layout problems pretty handily.

If a valid QR code with the exact width provided needs to be generated, you realistically would need a canvas.

You're a genius!

@vflyson vflyson referenced this pull request in AuthenticatedThoughts/jquery-qrcode Jun 13, 2014


<table> is not scaled properly in webKit #1

@fastfrwrd fastfrwrd closed this Oct 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment