Skip to content

Commit

Permalink
Improve missing resize2 plugin warning
Browse files Browse the repository at this point in the history
  • Loading branch information
LightArrowsEXE committed Dec 30, 2024
1 parent 26bcc4c commit edb6c97
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion vskernels/kernels/custom.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import annotations
from stgpytools import CustomValueError, KwargsT, inject_self
from stgpytools import CustomValueError, DependencyNotFoundError, KwargsT, inject_self
from inspect import Signature

from vstools import vs, core
Expand Down Expand Up @@ -40,6 +40,13 @@ def kernel(*, x: float) -> float:
def scale_function( # type: ignore[override]
self, clip: vs.VideoNode, width: int | None = None, height: int | None = None, *args: Any, **kwargs: Any
) -> vs.VideoNode:

if not hasattr(core, 'resize2'):
raise DependencyNotFoundError(
self.__class__, 'resize2', 'Missing dependency \'resize2\'! '
'You can find it here: https://github.com/Jaded-Encoding-Thaumaturgy/vapoursynth-resize2'
)

kernel, support = self._modify_kernel_func(kwargs)

clean_kwargs = {
Expand Down

0 comments on commit edb6c97

Please sign in to comment.