resize: added upscaling params for h & w #100
Annotations
2 errors
flask_iiif/api.py#L1
Black format check
--- /home/runner/work/flask-iiif/flask-iiif/flask_iiif/api.py 2024-08-21 09:18:11.633631+00:00
+++ /home/runner/work/flask-iiif/flask-iiif/flask_iiif/api.py 2024-08-21 09:18:47.792837+00:00
@@ -150,11 +150,11 @@
)
width = max(1, int(real_width * percent))
height = max(1, int(real_height * percent))
- # Check if it is `,h` or `^,h`
+ # Check if it is `,h` or `^,h`
elif dimensions.startswith(",") or dimensions.startswith("^,"):
if dimensions.startswith(","): # Handle `,h`
height = int(dimensions[1:])
else: # Handle `^,h`
height = int(dimensions[2:])
@@ -174,13 +174,17 @@
ratio = min(ratio_x, ratio_y)
# calculate the dimensions
width = max(1, int(real_width * ratio))
height = max(1, int(real_height * ratio))
- # Check if it is `w,` or `^w,`
- elif dimensions.endswith(",") or ((dimensions.startswith("^") and dimensions.endswith(","))):
- if dimensions.endswith(",") and not dimensions.startswith("^"): # Handle `w,`
+ # Check if it is `w,` or `^w,`
+ elif dimensions.endswith(",") or (
+ (dimensions.startswith("^") and dimensions.endswith(","))
+ ):
+ if dimensions.endswith(",") and not dimensions.startswith(
+ "^"
+ ): # Handle `w,`
width = int(dimensions[:-1])
else: # Handle `^w,`
width = int(dimensions[1:-1])
# find the ratio
|
|
This job failed
Loading