Spaces:
Sleeping
Sleeping
Aditya DN commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,7 @@ import qrcode
|
|
| 2 |
from PIL import Image
|
| 3 |
import base64
|
| 4 |
import gradio as gr
|
|
|
|
| 5 |
|
| 6 |
def encode_file_to_base64(file_path):
|
| 7 |
"""Reads any file and encodes it to base64."""
|
|
@@ -23,7 +24,7 @@ def generate_qr(data: str, error_correction: int = qrcode.constants.ERROR_CORREC
|
|
| 23 |
qr.make(fit=True)
|
| 24 |
img_qr = qr.make_image(fill_color=fill_color, back_color=back_color)
|
| 25 |
|
| 26 |
-
output_path = "
|
| 27 |
img_qr.save(output_path)
|
| 28 |
return output_path
|
| 29 |
|
|
|
|
| 2 |
from PIL import Image
|
| 3 |
import base64
|
| 4 |
import gradio as gr
|
| 5 |
+
import datetime
|
| 6 |
|
| 7 |
def encode_file_to_base64(file_path):
|
| 8 |
"""Reads any file and encodes it to base64."""
|
|
|
|
| 24 |
qr.make(fit=True)
|
| 25 |
img_qr = qr.make_image(fill_color=fill_color, back_color=back_color)
|
| 26 |
|
| 27 |
+
output_path = f"flowly_ai_pro_qr_codes_{datetime.datetime.now().strftime('%Y%m%d_%H%M%S')}.png"
|
| 28 |
img_qr.save(output_path)
|
| 29 |
return output_path
|
| 30 |
|