hdeldar commited on
Commit
1c7c08e
1 Parent(s): 1eae602

check image size for resize it

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -93,7 +93,9 @@ def main():
93
  #read the csv file and display the dataframe
94
  if file is not None:
95
  image = Image.open(file) # read image with PIL library
96
- image = image.resize((600, 400))
 
 
97
  st.image(image) #display
98
  holder.empty()
99
 
 
93
  #read the csv file and display the dataframe
94
  if file is not None:
95
  image = Image.open(file) # read image with PIL library
96
+ w, h = image.size
97
+ if w > 600 or h > 400:
98
+ image = image.resize((600, 400))
99
  st.image(image) #display
100
  holder.empty()
101