Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

width and height attributes of generated svg are huge #77

Open
bortunac opened this issue Sep 21, 2020 · 1 comment
Open

width and height attributes of generated svg are huge #77

bortunac opened this issue Sep 21, 2020 · 1 comment

Comments

@bortunac
Copy link

bortunac commented Sep 21, 2020

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
<svg xmlns="http://www.w3.org/2000/svg" height="333333...." width="33333...."> <path></path> </svg>

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

@heuer
Copy link
Contributor

heuer commented Sep 21, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants