Spaces:
Running
on
Zero
Running
on
Zero
cap image size, ensure result dimension is divisible by 32
Browse files
app.py
CHANGED
@@ -34,8 +34,8 @@ def resize_image_dimensions(
|
|
34 |
new_width = int(width * scaling_factor)
|
35 |
new_height = int(height * scaling_factor)
|
36 |
|
37 |
-
new_width = new_width - (new_width %
|
38 |
-
new_height = new_height - (new_height %
|
39 |
|
40 |
new_width = min(maximum_dimension, new_width)
|
41 |
new_height = min(maximum_dimension, new_height)
|
|
|
34 |
new_width = int(width * scaling_factor)
|
35 |
new_height = int(height * scaling_factor)
|
36 |
|
37 |
+
new_width = new_width - (new_width % 32)
|
38 |
+
new_height = new_height - (new_height % 32)
|
39 |
|
40 |
new_width = min(maximum_dimension, new_width)
|
41 |
new_height = min(maximum_dimension, new_height)
|