danieldeng commited on
Commit
8ac751c
·
verified ·
1 Parent(s): 2e6a23b

generate_qr_code path to image

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -20,11 +20,9 @@ def generate_qr_code(text:str)-> str: #it's import to specify the return type
20
  qr.add_data(text)
21
  qr.make(fit=True)
22
 
23
- img = qr.make_image(fill_color="black", back_color="white")
24
- file_path = "generated_qr.png"
25
- img.save(file_path)
26
 
27
- return f"The QR code has been successfully generated and saved to the following path: {file_path}"
28
  except Exception as e:
29
  return f"QR code generation failed: {str(e)}"
30
  # return "What magic will you build ?"
 
20
  qr.add_data(text)
21
  qr.make(fit=True)
22
 
23
+ img = qr.make_image(fill_color="black", back_color="white").convert('RGB')
 
 
24
 
25
+ return img
26
  except Exception as e:
27
  return f"QR code generation failed: {str(e)}"
28
  # return "What magic will you build ?"