Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -254,12 +254,17 @@ class FileProcessor:
|
|
254 |
logger.error(f"File processing error: {e}")
|
255 |
return []
|
256 |
|
257 |
-
def
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
|
|
|
|
|
|
|
|
|
|
263 |
|
264 |
def create_interface():
|
265 |
"""Create a comprehensive Gradio interface with advanced features"""
|
|
|
254 |
logger.error(f"File processing error: {e}")
|
255 |
return []
|
256 |
|
257 |
+
def generate_qr(json_data):
|
258 |
+
"""Generate QR code from JSON data and return the file path."""
|
259 |
+
qr = qrcode.QRCode(
|
260 |
+
version=40, # Force maximum version
|
261 |
+
error_correction=qrcode.constants.ERROR_CORRECT_L, # Use lower error correction
|
262 |
+
box_size=10,
|
263 |
+
border=4,
|
264 |
+
)
|
265 |
+
qr.add_data(json_data)
|
266 |
+
qr.make(fit=True)
|
267 |
+
return qr.make_image(fill_color="black", back_color="white")
|
268 |
|
269 |
def create_interface():
|
270 |
"""Create a comprehensive Gradio interface with advanced features"""
|