Skip to content

Commit 1678f7f

Browse files
committed
Add overloads for exif_transpose
1 parent 66f5a3f commit 1678f7f

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/PIL/ImageOps.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import operator
2323
import re
2424
from collections.abc import Sequence
25-
from typing import Protocol, cast
25+
from typing import Literal, Protocol, cast, overload
2626

2727
from . import ExifTags, Image, ImagePalette
2828

@@ -673,6 +673,16 @@ def solarize(image: Image.Image, threshold: int = 128) -> Image.Image:
673673
return _lut(image, lut)
674674

675675

676+
@overload
677+
def exif_transpose(image: Image.Image, *, in_place: Literal[True]) -> None: ...
678+
679+
680+
@overload
681+
def exif_transpose(
682+
image: Image.Image, *, in_place: Literal[False] = False
683+
) -> Image.Image: ...
684+
685+
676686
def exif_transpose(image: Image.Image, *, in_place: bool = False) -> Image.Image | None:
677687
"""
678688
If an image has an EXIF Orientation tag, other than 1, transpose the image

0 commit comments

Comments
 (0)