acecalisto3 commited on
Commit
b70851e
·
verified ·
1 Parent(s): 8af7113

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -254,12 +254,17 @@ class FileProcessor:
254
  logger.error(f"File processing error: {e}")
255
  return []
256
 
257
- def generate_qr_code(json_data):
258
- """Generate a QR code from JSON data."""
259
- qr = qrcode.make(json_data)
260
- qr_path = "output/qr_code.png"
261
- qr.save(qr_path)
262
- return qr_path
 
 
 
 
 
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"""