Skip to content

Commit c383e95

Browse files
authored
Fix box parameter type of Pillow.PIL.Image.paste (#8090)
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`)
1 parent 6b0c8df commit c383e95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stubs/Pillow/PIL/Image.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class Image:
163163
def getprojection(self) -> tuple[list[int], list[int]]: ...
164164
def histogram(self, mask: Image | None = ..., extrema: tuple[int, int] | tuple[float, float] | None = ...) -> list[int]: ...
165165
def entropy(self, mask: Image | None = ..., extrema: tuple[int, int] | tuple[float, float] | None = ...) -> float: ...
166-
def paste(self, im: Image | _Color, box: tuple[float, float] | _Box | None = ..., mask: Image | None = ...) -> None: ...
166+
def paste(self, im: Image | _Color, box: tuple[int, int] | _Box | None = ..., mask: Image | None = ...) -> None: ...
167167
def alpha_composite(self, im: Image, dest: tuple[int, int] = ..., source: tuple[int, int] = ...) -> None: ...
168168
def point(self, lut, mode: _Mode | None = ...) -> Image: ...
169169
def putalpha(self, alpha: Image | int) -> None: ...

0 commit comments

Comments
 (0)