Spaces:
Sleeping
Sleeping
generate_qr_code path to image
Browse files
app.py
CHANGED
|
@@ -20,11 +20,9 @@ def generate_qr_code(text:str)-> str: #it's import to specify the return type
|
|
| 20 |
qr.add_data(text)
|
| 21 |
qr.make(fit=True)
|
| 22 |
|
| 23 |
-
img = qr.make_image(fill_color="black", back_color="white")
|
| 24 |
-
file_path = "generated_qr.png"
|
| 25 |
-
img.save(file_path)
|
| 26 |
|
| 27 |
-
return
|
| 28 |
except Exception as e:
|
| 29 |
return f"QR code generation failed: {str(e)}"
|
| 30 |
# return "What magic will you build ?"
|
|
|
|
| 20 |
qr.add_data(text)
|
| 21 |
qr.make(fit=True)
|
| 22 |
|
| 23 |
+
img = qr.make_image(fill_color="black", back_color="white").convert('RGB')
|
|
|
|
|
|
|
| 24 |
|
| 25 |
+
return img
|
| 26 |
except Exception as e:
|
| 27 |
return f"QR code generation failed: {str(e)}"
|
| 28 |
# return "What magic will you build ?"
|