update image.size and rotate
Browse files
app.py
CHANGED
@@ -78,7 +78,6 @@ def main():
|
|
78 |
|
79 |
# Obtenir et afficher la taille de l'image
|
80 |
width, height = image.size
|
81 |
-
st.write(f"Largeur: {width} pixels, Hauteur: {height} pixels")
|
82 |
if width>1200 or height > 1200:
|
83 |
try:
|
84 |
exif = image._getexif()
|
@@ -93,6 +92,8 @@ def main():
|
|
93 |
elif orientation == 8:
|
94 |
image = image.rotate(90, expand=True)
|
95 |
# Affichage de l'image uploadée
|
|
|
|
|
96 |
st.image(image, caption='Image Uploadée', use_column_width=True)
|
97 |
except Exception as e:
|
98 |
st.write(f"Erreur lors de la correction de l'orientation: {e}")
|
@@ -100,6 +101,8 @@ def main():
|
|
100 |
image = image.resize((224, 224))
|
101 |
else:
|
102 |
# Affichage de l'image uploadée
|
|
|
|
|
103 |
st.image(image, caption='Image Uploadée', use_column_width=True)
|
104 |
|
105 |
|
|
|
78 |
|
79 |
# Obtenir et afficher la taille de l'image
|
80 |
width, height = image.size
|
|
|
81 |
if width>1200 or height > 1200:
|
82 |
try:
|
83 |
exif = image._getexif()
|
|
|
92 |
elif orientation == 8:
|
93 |
image = image.rotate(90, expand=True)
|
94 |
# Affichage de l'image uploadée
|
95 |
+
width, height = image.size
|
96 |
+
st.write(f"Largeur: {width} pixels, Hauteur: {height} pixels")
|
97 |
st.image(image, caption='Image Uploadée', use_column_width=True)
|
98 |
except Exception as e:
|
99 |
st.write(f"Erreur lors de la correction de l'orientation: {e}")
|
|
|
101 |
image = image.resize((224, 224))
|
102 |
else:
|
103 |
# Affichage de l'image uploadée
|
104 |
+
width, height = image.size
|
105 |
+
st.write(f"Largeur: {width} pixels, Hauteur: {height} pixels")
|
106 |
st.image(image, caption='Image Uploadée', use_column_width=True)
|
107 |
|
108 |
|