Anne31415 commited on
Commit
578a148
·
verified ·
1 Parent(s): bb380bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -254,8 +254,22 @@ def page1():
254
 
255
  with col2:
256
  # Load and display the image in the right column, which will be the top-right corner of the page
257
- image = Image.open('BinDoc Logo (Quadratisch).png')
 
 
 
 
 
 
 
 
 
258
  st.image(image, use_column_width='always')
 
 
 
 
 
259
 
260
 
261
  if not os.path.exists(pdf_path):
 
254
 
255
  with col2:
256
  # Load and display the image in the right column, which will be the top-right corner of the page
257
+
258
+
259
+ # Attempt to load the image with enhanced error handling
260
+ try:
261
+ # Construct the absolute path to the image file
262
+ current_dir = os.getcwd() # Get the current working directory
263
+ image_path = os.path.join(current_dir, 'BinDoc Logo (Quadratisch).png')
264
+
265
+ # Load and display the image
266
+ image = Image.open(image_path)
267
  st.image(image, use_column_width='always')
268
+ except FileNotFoundError:
269
+ st.error(f"File not found. Please check the file path. Attempted path: {image_path}")
270
+ except Exception as e:
271
+ st.error(f"An unexpected error occurred while loading the image: {e}")
272
+
273
 
274
 
275
  if not os.path.exists(pdf_path):