doevent commited on
Commit
8147c97
1 Parent(s): f21a301

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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
- #ratio_width = load_img.size[0]
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
 
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