Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -22,9 +22,9 @@ def calculate_optimal_dimensions(image: Image.Image):
|
|
22 |
# Extract the original dimensions
|
23 |
original_width, original_height = image.size
|
24 |
|
25 |
-
# Set constants
|
26 |
-
MIN_ASPECT_RATIO =
|
27 |
-
MAX_ASPECT_RATIO =
|
28 |
FIXED_DIMENSION = 1024
|
29 |
|
30 |
# Calculate the aspect ratio of the original image
|
|
|
22 |
# Extract the original dimensions
|
23 |
original_width, original_height = image.size
|
24 |
|
25 |
+
# Set constants for enforcing a roughly 2:1 aspect ratio
|
26 |
+
MIN_ASPECT_RATIO = 1.8
|
27 |
+
MAX_ASPECT_RATIO = 2.2
|
28 |
FIXED_DIMENSION = 1024
|
29 |
|
30 |
# Calculate the aspect ratio of the original image
|