Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,7 +24,12 @@ def generate_qr_code(text:str)-> AgentImage: #it's import to specify the return
|
|
| 24 |
qr.make(fit=True)
|
| 25 |
img = qr.make_image(fill_color="black", back_color="white").convert('RGB')
|
| 26 |
print(img.size)
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
except Exception as e:
|
| 29 |
return f"Error generating QR code:{str(e)}"
|
| 30 |
# return "What magic will you build ?"
|
|
|
|
| 24 |
qr.make(fit=True)
|
| 25 |
img = qr.make_image(fill_color="black", back_color="white").convert('RGB')
|
| 26 |
print(img.size)
|
| 27 |
+
filename = "my_qr_code.png"
|
| 28 |
+
save_path = os.path.abspath(filename)
|
| 29 |
+
img.save(save_path)
|
| 30 |
+
print(f"DEBUG: Saved absolute path to: {save_path}")
|
| 31 |
+
return AgentImage(save_path)
|
| 32 |
+
# return AgentImage(img)
|
| 33 |
except Exception as e:
|
| 34 |
return f"Error generating QR code:{str(e)}"
|
| 35 |
# return "What magic will you build ?"
|