nikzarifie commited on
Commit
5df5184
1 Parent(s): b8a48dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  import qrcode
2
  import gradio as gr
3
  from io import BytesIO
@@ -9,8 +12,8 @@ BEGIN:VCARD
9
  VERSION:3.0
10
  FN:{name}
11
  TEL;TYPE=WORK,VOICE:{contact_number_work}
12
- TEL;TYPE=CELL:{contact_number_mobile}
13
- EMAIL;TYPE=INTERNET:{email}
14
  TITLE:{designation}
15
  URL:{website}
16
  ADR;TYPE=WORK:;;{work_address}
@@ -34,7 +37,7 @@ END:VCARD
34
 
35
  return Image.open(buffer)
36
 
37
- def create_business_card(name, contact_number_work, contact_number_mobile, email, designation, website, work_address, user_image_path):
38
  qr_code_img = generate_vcard(name, contact_number_work, contact_number_mobile, email, designation, website, work_address)
39
 
40
  card_width, card_height = 600, 300
@@ -43,7 +46,7 @@ def create_business_card(name, contact_number_work, contact_number_mobile, email
43
 
44
  try:
45
  # Load and resize the user image
46
- user_image = Image.open(user_image_path).convert("RGBA")
47
  user_image = user_image.resize((150, 150), Image.ANTIALIAS)
48
  card.paste(user_image, (20, 75), user_image)
49
  except Exception as e:
 
1
+ !pip install qrcode
2
+ !pip install gradio
3
+
4
  import qrcode
5
  import gradio as gr
6
  from io import BytesIO
 
12
  VERSION:3.0
13
  FN:{name}
14
  TEL;TYPE=WORK,VOICE:{contact_number_work}
15
+ TEL;TYPE=MOBILE,VOICE:{contact_number_mobile}
16
+ EMAIL;TYPE=PREF,INTERNET:{email}
17
  TITLE:{designation}
18
  URL:{website}
19
  ADR;TYPE=WORK:;;{work_address}
 
37
 
38
  return Image.open(buffer)
39
 
40
+ def create_business_card(name, contact_number_work, contact_number_mobile, email, designation, website, work_address, user_image):
41
  qr_code_img = generate_vcard(name, contact_number_work, contact_number_mobile, email, designation, website, work_address)
42
 
43
  card_width, card_height = 600, 300
 
46
 
47
  try:
48
  # Load and resize the user image
49
+ user_image = Image.open(user_image).convert("RGBA")
50
  user_image = user_image.resize((150, 150), Image.ANTIALIAS)
51
  card.paste(user_image, (20, 75), user_image)
52
  except Exception as e: