mnooner256 / pyqrcode

Python 3 module to generate QR Codes
BSD 3-Clause "New" or "Revised" License
408 stars 74 forks source link

width and height attributes of generated svg are huge #77

Open bortunac opened 3 years ago

bortunac commented 3 years ago

runing

`#!/usr/bin/python
import sys
import pyqrcode
text = sys.argv[1]
scale = sys.argv[2]
err_prt = sys.argv[3]
url = pyqrcode.create(text,err_prt) # error_protection in ['L','M','H'] -- Low make code smaller
url.svg(sys.stdout, scale, module_color="black", quiet_zone=1)
exit(0)`

with 'text' 3 'M' returns
`

`

I resolved this remeasuring o client side but ... maybe I am wrong

heuer commented 3 years ago

Please check again, I get a different aka correct result:

<svg xmlns="http://www.w3.org/2000/svg" height="87" width="87" class="pyqrcode"><path transform="scale(3)" stroke="#000" class="pyqrline" d="M4 4.5h7m2 0h1m1 0h1m2 0h7m-21 1h1m5 0h1m1 0h1m2 0h2m1 0h1m5 0h1m-21 1h1m1 0h3m1 0h1m2 0h1m1 0h2m1 0h1m1 0h3m1 0h1m-21 1h1m1 0h3m1 0h1m2 0h1m4 0h1m1 0h3m1 0h1m-21 1h1m1 0h3m1 0h1m1 0h1m1 0h3m1 0h1m1 0h3m1 0h1m-21 1h1m5 0h1m4 0h1m2 0h1m5 0h1m-21 1h7m1 0h1m1 0h1m1 0h1m1 0h7m-21 2h1m1 0h1m1 0h1m1 0h1m3 0h1m1 0h1m3 0h1m2 0h1m-17 1h1m3 0h1m2 0h2m1 0h1m1 0h1m3 0h2m-21 1h1m2 0h1m1 0h3m1 0h1m1 0h1m1 0h3m1 0h4m-21 1h1m3 0h2m1 0h1m2 0h4m1 0h2m2 0h1m-19 1h3m2 0h2m1 0h1m1 0h1m1 0h3m1 0h1m1 0h2m-13 1h2m4 0h1m2 0h2m1 0h1m-21 1h7m2 0h1m2 0h1m3 0h1m1 0h3m-21 1h1m5 0h1m2 0h2m3 0h1m4 0h1m-20 1h1m1 0h3m1 0h1m1 0h1m3 0h1m1 0h1m1 0h2m1 0h2m-21 1h1m1 0h3m1 0h1m2 0h1m1 0h1m1 0h1m1 0h1m3 0h1m-20 1h1m1 0h3m1 0h1m1 0h1m2 0h1m1 0h3m2 0h1m1 0h1m-21 1h1m5 0h1m2 0h1m1 0h3m1 0h3m1 0h1m-20 1h7m1 0h1m1 0h2m1 0h3m2 0h3"/></svg>

You omit module_color="black" since it is the default anyway.