mahreenfathima commited on
Commit
9da2339
Β·
verified Β·
1 Parent(s): 60e40c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -30,6 +30,19 @@ if missing:
30
  # πŸ› DEBUG: If you see this, HTML is loading
31
  # </div>
32
  # """)
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  css = f"""
35
  /* Global App Styling */
@@ -204,19 +217,6 @@ css = f"""
204
  }}
205
  """
206
 
207
- def image_to_base64(filepath):
208
- try:
209
- with open(filepath, "rb") as image_file:
210
- encoded_string = base64.b64encode(image_file.read()).decode('utf-8')
211
- mime_type = "image/jpeg" if filepath.lower().endswith((".jpg", ".jpeg")) else "image/png"
212
- return f"data:{mime_type};base64,{encoded_string}"
213
- except FileNotFoundError:
214
- print(f"Error: Image file not found at {filepath}")
215
- return ""
216
-
217
-
218
- image_data_url = image_to_base64("static/new.jpg")
219
- full_img = image_to_base64("static/fullnew.jpg")
220
 
221
  def app():
222
 
 
30
  # πŸ› DEBUG: If you see this, HTML is loading
31
  # </div>
32
  # """)
33
+ def image_to_base64(filepath):
34
+ try:
35
+ with open(filepath, "rb") as image_file:
36
+ encoded_string = base64.b64encode(image_file.read()).decode('utf-8')
37
+ mime_type = "image/jpeg" if filepath.lower().endswith((".jpg", ".jpeg")) else "image/png"
38
+ return f"data:{mime_type};base64,{encoded_string}"
39
+ except FileNotFoundError:
40
+ print(f"Error: Image file not found at {filepath}")
41
+ return ""
42
+
43
+
44
+ image_data_url = image_to_base64("static/new.jpg")
45
+ full_img = image_to_base64("static/fullnew.jpg")
46
 
47
  css = f"""
48
  /* Global App Styling */
 
217
  }}
218
  """
219
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
 
221
  def app():
222