Skip to content

Commit

Permalink
Remove keep_ar warning, fix operations
Browse files Browse the repository at this point in the history
  • Loading branch information
LightArrowsEXE committed Jul 3, 2024
1 parent 1dcdfff commit 2dbfd65
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions vskernels/kernels/complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,6 @@ def _get_kwargs_keep_ar(
) -> KwargsT:
kwargs = KwargsT(keep_ar=keep_ar, sar=sar, dar=dar) | kwargs

if None not in set(kwargs.get(x) for x in ('keep_ar', 'sar', 'dar')):
print(UserWarning(
f'{self.__class__.__name__}.scale: "keep_ar" set '
'with non-None values set in "sar" and "dar" won\'t do anything!'
))

default_val = kwargs.pop('keep_ar')

for key in ('sar', 'dar'):
Expand Down Expand Up @@ -175,8 +169,8 @@ def _handle_crop_resize_kwargs( # type: ignore[override]
kwargs['src_left'] += (kwargs['src_width'] - kwargs['src_width'] / sar) / 2
kwargs['src_width'] /= sar
else:
kwargs['src_top'] += (kwargs['src_height'] - kwargs['src_height'] / sar) / 2
kwargs['src_height'] /= sar
kwargs['src_top'] -= (kwargs['src_height'] - kwargs['src_height'] / sar) / 2
kwargs['src_height'] *= sar

out_sar = Sar(1, 1)

Expand Down

0 comments on commit 2dbfd65

Please sign in to comment.