Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,15 +25,15 @@ def take_screenshot(url):
|
|
| 25 |
|
| 26 |
image = Image.open(BytesIO(screenshot))
|
| 27 |
|
| 28 |
-
#
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
|
| 38 |
return image
|
| 39 |
|
|
|
|
| 25 |
|
| 26 |
image = Image.open(BytesIO(screenshot))
|
| 27 |
|
| 28 |
+
# Center crop
|
| 29 |
+
width, height = image.size
|
| 30 |
+
crop_size_side = 1280
|
| 31 |
+
crop_size_top = 1280
|
| 32 |
+
left = (width - crop_size_side) // 2
|
| 33 |
+
top = (height - crop_size_top) // 2
|
| 34 |
+
right = left + 1000
|
| 35 |
+
bottom = top + 600
|
| 36 |
+
cropped_image = image.crop((left, top, right, bottom))
|
| 37 |
|
| 38 |
return image
|
| 39 |
|