jquery-qrcode icon indicating copy to clipboard operation
jquery-qrcode copied to clipboard

Ensure the tile width and height values are integers.

Open gorbster opened this issue 13 years ago • 2 comments

This should address the issue here:

https://github.com/jeromeetienne/jquery-qrcode/issues/7

Currently, if the specified width / number of calculated modules is a non-integer value, fillRect() will attempt a sub-pixel draw resulting in artifacts between the rendered tiles.

By flooring the tile width and height, this problem should be alleviated.

gorbster avatar Dec 03 '11 03:12 gorbster

can you give some values for me to reproduce this issue ?

jeromeetienne avatar Dec 05 '11 11:12 jeromeetienne

The barcode strings I'm working with are about 20 characters long, and I see the artifacts when I try rendering anything with a larger size of 200px.

I see this in Chrome, Safari, and Mobile Safari. Here's what it looks like in Chrome:

http://cl.ly/1y1Q2U01240n3U0K0l37

And here are the parameters I used:

    jQuery('#qrcode').qrcode({
        render  : "canvas",
        text    : "12345678901234567890",
        width   : 400,
        height  : 400
    }); 

gorbster avatar Dec 05 '11 18:12 gorbster