diff --git a/pylibjpeg/utils.py b/pylibjpeg/utils.py index 747e670..642e945 100644 --- a/pylibjpeg/utils.py +++ b/pylibjpeg/utils.py @@ -32,7 +32,7 @@ def __call__(self, src: bytes, **kwargs: Any) -> np.ndarray: class Encoder(Protocol): - def __call__(self, src: np.ndarray, **kwargs: Any) -> Union[bytes, bytearray]: + def __call__(self, src: Union[np.ndarray, bytes], **kwargs: Any) -> Union[bytes, bytearray]: ... # pragma: no cover @@ -347,7 +347,10 @@ def get_pixel_data_decoders( entry_point = "pylibjpeg.pixel_data_decoders" decoders = cast( - Union[Dict[str, Decoder], Dict[str, Dict[str, Decoder]]], + Union[ + Dict[str, Union[Decoder, Encoder]], + Dict[str, Dict[str, Union[Decoder, Encoder]]], + ], _get_pixel_data_plugins(entry_point, version), ) return decoders diff --git a/pyproject.toml b/pyproject.toml index 086ee89..91faa5a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ license = {text = "MIT"} name = "pylibjpeg" readme = "README.md" requires-python = ">=3.8" -version = "2.0.0" +version = "2.0.1" [project.optional-dependencies]