Skip to content

Commit

Permalink
Fix zero padding border handling (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
emotion3459 authored Sep 13, 2024
1 parent d4ae0de commit b1db617
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vskernels/kernels/complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def scale( # type: ignore[override]
padded = border_handling.prepare_clip(clip, self.kernel_radius)

shift, clip = tuple(
s + ((p - c) // 2) for s, c, p in zip(shift, *((x.width, x.height) for x in (clip, padded)))
s + ((p - c) // 2) for s, c, p in zip(shift, *((x.height, x.width) for x in (clip, padded)))
), padded

clip = Scaler.scale(self, clip, width, height, shift, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion vskernels/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def prepare_clip(self, clip: vs.VideoNode, min_pad: int = 2) -> vs.VideoNode:
case BorderHandling.MIRROR:
return padder.MIRROR(*args)
case BorderHandling.ZERO:
return padder.COLOR(*args)
return padder.COLOR(color=False if clip.format.color_family is vs.RGB else (False, None), *args)
case BorderHandling.REPEAT:
return padder.REPEAT(*args)

Expand Down

0 comments on commit b1db617

Please sign in to comment.