mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-24 16:24:11 +03:00
Added type hints to GdImageFile
This commit is contained in:
parent
20830c541e
commit
d8c7af0157
|
@ -27,6 +27,8 @@
|
||||||
"""
|
"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from io import BytesIO
|
||||||
|
|
||||||
from . import ImageFile, ImagePalette, UnidentifiedImageError
|
from . import ImageFile, ImagePalette, UnidentifiedImageError
|
||||||
from ._binary import i16be as i16
|
from ._binary import i16be as i16
|
||||||
from ._binary import i32be as i32
|
from ._binary import i32be as i32
|
||||||
|
@ -43,8 +45,10 @@ class GdImageFile(ImageFile.ImageFile):
|
||||||
format = "GD"
|
format = "GD"
|
||||||
format_description = "GD uncompressed images"
|
format_description = "GD uncompressed images"
|
||||||
|
|
||||||
def _open(self):
|
def _open(self) -> None:
|
||||||
# Header
|
# Header
|
||||||
|
assert self.fp is not None
|
||||||
|
|
||||||
s = self.fp.read(1037)
|
s = self.fp.read(1037)
|
||||||
|
|
||||||
if i16(s) not in [65534, 65535]:
|
if i16(s) not in [65534, 65535]:
|
||||||
|
@ -76,7 +80,7 @@ class GdImageFile(ImageFile.ImageFile):
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def open(fp, mode="r"):
|
def open(fp: BytesIO, mode: str = "r") -> GdImageFile:
|
||||||
"""
|
"""
|
||||||
Load texture from a GD image file.
|
Load texture from a GD image file.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user