From 8fcebadae662e212ff51f01c96f816d73bfff461 Mon Sep 17 00:00:00 2001 From: eggplants Date: Fri, 17 Jun 2022 08:25:13 +0900 Subject: [PATCH] fix: `box` parameter type of `Pillow.PIL.Image.paste` When executing `img.paste(cropped, box=(10.5, 10.5))`: TypeError: 'float' object cannot be interpreted as an integer So the `box` parameter's type should be not `tuple[float, float]` but `tuple[int, int]`. (same as `_Box`) --- stubs/Pillow/PIL/Image.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/Pillow/PIL/Image.pyi b/stubs/Pillow/PIL/Image.pyi index 67751755b41a..2248853692e8 100644 --- a/stubs/Pillow/PIL/Image.pyi +++ b/stubs/Pillow/PIL/Image.pyi @@ -163,7 +163,7 @@ class Image: def getprojection(self) -> tuple[list[int], list[int]]: ... def histogram(self, mask: Image | None = ..., extrema: tuple[int, int] | tuple[float, float] | None = ...) -> list[int]: ... def entropy(self, mask: Image | None = ..., extrema: tuple[int, int] | tuple[float, float] | None = ...) -> float: ... - def paste(self, im: Image | _Color, box: tuple[float, float] | _Box | None = ..., mask: Image | None = ...) -> None: ... + def paste(self, im: Image | _Color, box: tuple[int, int] | _Box | None = ..., mask: Image | None = ...) -> None: ... def alpha_composite(self, im: Image, dest: tuple[int, int] = ..., source: tuple[int, int] = ...) -> None: ... def point(self, lut, mode: _Mode | None = ...) -> Image: ... def putalpha(self, alpha: Image | int) -> None: ...