mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
add type hints for Image.save
This commit is contained in:
parent
8c14a394c1
commit
819e1b9dd2
|
@ -2374,7 +2374,9 @@ class Image:
|
||||||
(w, h), Transform.AFFINE, matrix, resample, fillcolor=fillcolor
|
(w, h), Transform.AFFINE, matrix, resample, fillcolor=fillcolor
|
||||||
)
|
)
|
||||||
|
|
||||||
def save(self, fp, format=None, **params) -> None:
|
def save(
|
||||||
|
self, fp: StrOrBytesPath | IO[bytes], format: str | None = None, **params: Any
|
||||||
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Saves this image under the given filename. If no format is
|
Saves this image under the given filename. If no format is
|
||||||
specified, the format to use is determined from the filename
|
specified, the format to use is determined from the filename
|
||||||
|
@ -2455,6 +2457,8 @@ class Image:
|
||||||
fp = builtins.open(filename, "r+b")
|
fp = builtins.open(filename, "r+b")
|
||||||
else:
|
else:
|
||||||
fp = builtins.open(filename, "w+b")
|
fp = builtins.open(filename, "w+b")
|
||||||
|
else:
|
||||||
|
fp = cast(IO[bytes], fp)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
save_handler(self, fp, filename)
|
save_handler(self, fp, filename)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user