Update app.py
Browse files
app.py
CHANGED
@@ -25,11 +25,11 @@ def main(img):
|
|
25 |
# Checking Image Aspect Ratio
|
26 |
#load_img = Image.open(img)
|
27 |
#image size
|
28 |
-
|
29 |
#ratio_height = load_img.size[1]
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
|
34 |
# setup folder and path
|
35 |
#basewidth = 256
|
|
|
25 |
# Checking Image Aspect Ratio
|
26 |
#load_img = Image.open(img)
|
27 |
#image size
|
28 |
+
ratio_width, ratio_height = img.size
|
29 |
#ratio_height = load_img.size[1]
|
30 |
+
print(f"Aspect ratio: {ratio_width}x{ratio_height} px")
|
31 |
+
if ratio_width >= 1026 or ratio_height >= 1026:
|
32 |
+
raise gr.Error("Image aspect ratio must not exceed width: 1024 px and height: 1024 px.")
|
33 |
|
34 |
# setup folder and path
|
35 |
#basewidth = 256
|