Spaces:
Runtime error
Runtime error
Update qr.py
Browse files
qr.py
CHANGED
|
@@ -13,7 +13,7 @@ def make_qr(txt=None,data=None,im_size=None):
|
|
| 13 |
imr = open(f'tmp.jpg','rb')
|
| 14 |
out = f'{txt}+++{base64.b64encode(imr.read())}'
|
| 15 |
print (f'txt+data {out}')
|
| 16 |
-
img1 = qr.make(out,box_size=10,error_correction=
|
| 17 |
img1.save("im.png")
|
| 18 |
return "im.png"
|
| 19 |
if txt == None or txt == "" and data != None:
|
|
@@ -23,14 +23,14 @@ def make_qr(txt=None,data=None,im_size=None):
|
|
| 23 |
imr = open(f'tmp1.jpg','rb')
|
| 24 |
out = f'+++{base64.b64encode(imr.read())}'
|
| 25 |
print (f'data {out}')
|
| 26 |
-
img1 = qr.make(out,box_size=10,error_correction=
|
| 27 |
img1.save("im1.png")
|
| 28 |
return "im1.png"
|
| 29 |
|
| 30 |
if txt != None and txt != "" and data == None:
|
| 31 |
out = f'{txt}'
|
| 32 |
print (f'txt {out}')
|
| 33 |
-
img1 = qr.make(out,box_size=10,error_correction=
|
| 34 |
img1.save("im2.png")
|
| 35 |
return "im2.png"
|
| 36 |
|
|
|
|
| 13 |
imr = open(f'tmp.jpg','rb')
|
| 14 |
out = f'{txt}+++{base64.b64encode(imr.read())}'
|
| 15 |
print (f'txt+data {out}')
|
| 16 |
+
img1 = qr.make(out,box_size=10,error_correction=qr.constants.ERROR_CORRECT_H)
|
| 17 |
img1.save("im.png")
|
| 18 |
return "im.png"
|
| 19 |
if txt == None or txt == "" and data != None:
|
|
|
|
| 23 |
imr = open(f'tmp1.jpg','rb')
|
| 24 |
out = f'+++{base64.b64encode(imr.read())}'
|
| 25 |
print (f'data {out}')
|
| 26 |
+
img1 = qr.make(out,box_size=10,error_correction=qr.constants.ERROR_CORRECT_H)
|
| 27 |
img1.save("im1.png")
|
| 28 |
return "im1.png"
|
| 29 |
|
| 30 |
if txt != None and txt != "" and data == None:
|
| 31 |
out = f'{txt}'
|
| 32 |
print (f'txt {out}')
|
| 33 |
+
img1 = qr.make(out,box_size=10,error_correction=qr.constants.ERROR_CORRECT_H)
|
| 34 |
img1.save("im2.png")
|
| 35 |
return "im2.png"
|
| 36 |
|