You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 28, 2022. It is now read-only.
This commit 1fac6ee attempted to fix the problem with the aspect ratios which are not in the configuration.
I would either:
Create a decorator which we can use in every single function which gets display_aspect_ratio as parameter and it will change it to the correct one if needed.
Take it with a grain of salt, probably we need to order correctly the function arguments to make it work or use the display_aspect_ratio always as a keyword argument.
let if fail if we pass the wrong aspect ratio and make the "client", in our case webhooks/tasks.py, handle the error (or maybe send already the correct aspect ratio).
or use the function we have already and call it every time we have an aspect ratio related calculation.
--
There is also a problem with the commit itself, this is how it should be otherwise it will return the wrong type of object
- raise InvalidAspectRatioError(display_aspect_ratio)+ if max_height and max_width:+ display_aspect_ratio = get_closest_aspect_ratio(max_height, max_width)+ aspect_ratio = current_app.config['CDS_SORENSON_PRESETS'][+ display_aspect_ratio]+ else:+ raise InvalidAspectRatioError(display_aspect_ratio)