Skip to content

Commit d6e1ebf

Browse files
committed
Allow all ImageFont getbbox() methods to accept bytearray
1 parent d6fb1ae commit d6e1ebf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/PIL/ImageFont.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def getlength(
404404

405405
def getbbox(
406406
self,
407-
text: str | bytes,
407+
text: str | bytes | bytearray,
408408
mode: str = "",
409409
direction: str | None = None,
410410
features: list[str] | None = None,
@@ -772,7 +772,7 @@ def getmask(
772772
return im
773773

774774
def getbbox(
775-
self, text: str | bytes, *args: Any, **kwargs: Any
775+
self, text: str | bytes | bytearray, *args: Any, **kwargs: Any
776776
) -> tuple[int, int, float, float]:
777777
# TransposedFont doesn't support getmask2, move top-left point to (0, 0)
778778
# this has no effect on ImageFont and simulates anchor="lt" for FreeTypeFont

0 commit comments

Comments
 (0)