alexeyten / qr-image

Yet another QR code generator
MIT License
1.05k stars 168 forks source link

Can't set image width and height? #27

Closed 953133667 closed 8 years ago

953133667 commented 8 years ago

This is my code: (My system is win7)

var qr = require('qr-image');

var png_string = qr.imageSync("http://www.google.com/");
 fs.writeFile("e:/qrcodes/"+data[i].name+".png", png_string, 'utf8');

Default ,Createed images width and height is 225 pixel. I need width and height is 2000 pixel. Please help me ,Thx !

alexeyten commented 8 years ago

There is no options for image size, only for “module” (one square) size. Image size obviously depends on size of text you want to encode. You could try to set module size to something big (e.g. qr.imageSync("http://www.google.com/", {size: 44});).

But actually, I don't see any reason to generate image so huge. May be you should use SVG? It will perfectly scale to any size you want.

953133667 commented 8 years ago

OK ,Thx !