Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,8 @@ def fill_rectangle_cropper(img):
|
|
25 |
(img.height, img.height),
|
26 |
(round(avg_color[0]), round(avg_color[1]), round(avg_color[2]))
|
27 |
)
|
28 |
-
newpos = (img.
|
|
|
29 |
|
30 |
newimg.paste(img, (newpos, 0))
|
31 |
return newimg
|
@@ -36,7 +37,7 @@ def fill_rectangle_cropper(img):
|
|
36 |
(img.width, img.width),
|
37 |
(round(avg_color[0]), round(avg_color[1]), round(avg_color[2]))
|
38 |
)
|
39 |
-
newpos = (img.
|
40 |
newimg.paste(img, (0, newpos))
|
41 |
return newimg
|
42 |
else:
|
|
|
25 |
(img.height, img.height),
|
26 |
(round(avg_color[0]), round(avg_color[1]), round(avg_color[2]))
|
27 |
)
|
28 |
+
newpos = (img.height - img.width) // 2
|
29 |
+
|
30 |
|
31 |
newimg.paste(img, (newpos, 0))
|
32 |
return newimg
|
|
|
37 |
(img.width, img.width),
|
38 |
(round(avg_color[0]), round(avg_color[1]), round(avg_color[2]))
|
39 |
)
|
40 |
+
newpos = (img.width - img.height) // 2
|
41 |
newimg.paste(img, (0, newpos))
|
42 |
return newimg
|
43 |
else:
|