mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-03-13 01:05:48 +03:00
Add overloads for exif_transpose
This commit is contained in:
parent
66f5a3facc
commit
1678f7f215
|
@ -22,7 +22,7 @@ import functools
|
|||
import operator
|
||||
import re
|
||||
from collections.abc import Sequence
|
||||
from typing import Protocol, cast
|
||||
from typing import Literal, Protocol, cast, overload
|
||||
|
||||
from . import ExifTags, Image, ImagePalette
|
||||
|
||||
|
@ -673,6 +673,16 @@ def solarize(image: Image.Image, threshold: int = 128) -> Image.Image:
|
|||
return _lut(image, lut)
|
||||
|
||||
|
||||
@overload
|
||||
def exif_transpose(image: Image.Image, *, in_place: Literal[True]) -> None: ...
|
||||
|
||||
|
||||
@overload
|
||||
def exif_transpose(
|
||||
image: Image.Image, *, in_place: Literal[False] = False
|
||||
) -> Image.Image: ...
|
||||
|
||||
|
||||
def exif_transpose(image: Image.Image, *, in_place: bool = False) -> Image.Image | None:
|
||||
"""
|
||||
If an image has an EXIF Orientation tag, other than 1, transpose the image
|
||||
|
|
Loading…
Reference in New Issue
Block a user