From 3bf165d723310732bc4aa2ff28d15f54f5e120df Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 20 Dec 2021 20:47:01 -0500 Subject: [PATCH] correct border= and fill= kwargs for ImageOps.expand (#6641) --- stubs/Pillow/PIL/ImageOps.pyi | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/stubs/Pillow/PIL/ImageOps.pyi b/stubs/Pillow/PIL/ImageOps.pyi index bff43f61b..2c84e4dc6 100644 --- a/stubs/Pillow/PIL/ImageOps.pyi +++ b/stubs/Pillow/PIL/ImageOps.pyi @@ -1,6 +1,9 @@ -from typing import Any, Iterable, Protocol +from typing import Any, Iterable, Protocol, Union from .Image import Image, _Resample, _Size +from .ImageColor import _Ink + +_Border = Union[int, tuple[int, int], tuple[int, int, int, int]] class _Deformer(Protocol): def getmesh(self, image: Image): ... @@ -21,11 +24,11 @@ def contain(image: Image, size: _Size, method: _Resample = ...) -> Image: ... def pad( image: Image, size: _Size, method: _Resample = ..., color: Any | None = ..., centering: Iterable[float] = ... ) -> Image: ... -def crop(image: Image, border: int = ...) -> Image: ... +def crop(image: Image, border: _Border = ...) -> Image: ... def scale(image: Image, factor: float, resample: _Resample = ...) -> Image: ... def deform(image: Image, deformer: _Deformer, resample: _Resample = ...) -> Image: ... def equalize(image: Image, mask: Any | None = ...) -> Image: ... -def expand(image: Image, border: int = ..., fill: int = ...) -> Image: ... +def expand(image: Image, border: _Border = ..., fill: _Ink = ...) -> Image: ... def fit(image: Image, size: _Size, method: _Resample = ..., bleed: float = ..., centering: Iterable[float] = ...) -> Image: ... def flip(image: Image) -> Image: ... def grayscale(image: Image) -> Image: ...