Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -378,21 +378,21 @@ def process_all_inputs(urls, file, text, notes):
|
|
378 |
logger.error(f"Processing error: {e}")
|
379 |
return None, f"Error: {str(e)}", ""
|
380 |
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
qr.add_data(json_data)
|
390 |
qr.make(fit=True)
|
391 |
return qr.make_image(fill_color="black", back_color="white")
|
392 |
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
|
397 |
process_btn.click(
|
398 |
process_all_inputs,
|
|
|
378 |
logger.error(f"Processing error: {e}")
|
379 |
return None, f"Error: {str(e)}", ""
|
380 |
|
381 |
+
def generate_qr(json_data):
|
382 |
+
"""Generate QR code from JSON data and return the file path."""
|
383 |
+
qr = qrcode.QRCode(
|
384 |
+
version=40, # Force maximum version
|
385 |
+
error_correction=qrcode.constants.ERROR_CORRECT_L, # Use lower error correction
|
386 |
+
box_size=10,
|
387 |
+
border=4,
|
388 |
+
)
|
389 |
qr.add_data(json_data)
|
390 |
qr.make(fit=True)
|
391 |
return qr.make_image(fill_color="black", back_color="white")
|
392 |
|
393 |
+
if json_data:
|
394 |
+
return generate_qr_code(json_data)
|
395 |
+
return None
|
396 |
|
397 |
process_btn.click(
|
398 |
process_all_inputs,
|