check image size for resize it
Browse files
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 |
-
|
|
|
|
|
|
|
| 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 |
|