Simonlob commited on
Commit
25f098e
·
verified ·
1 Parent(s): c264d54

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -40,12 +40,15 @@ def generate_qr(url, fill_color=None, back_color=None):
40
  Returns:
41
  PIL.Image: Generated QR code image
42
  """
43
- print(fill_color)
44
  try:
45
  # Validate URL/data is not empty
46
  if not url:
47
  raise ValueError("URL or data cannot be empty")
48
 
 
 
 
 
49
  # Generate QR code with optional color parameters
50
  return get_qr_image(url, fill_color, back_color)
51
 
 
40
  Returns:
41
  PIL.Image: Generated QR code image
42
  """
 
43
  try:
44
  # Validate URL/data is not empty
45
  if not url:
46
  raise ValueError("URL or data cannot be empty")
47
 
48
+ # Convert empty strings to None
49
+ fill_color = fill_color.strip() if fill_color else None
50
+ back_color = back_color.strip() if back_color else None
51
+
52
  # Generate QR code with optional color parameters
53
  return get_qr_image(url, fill_color, back_color)
54