Skip to content

Commit 7f646a6

Browse files
committed
Mark load as returning PixelAccess | PyAccess
1 parent 42c8e23 commit 7f646a6

8 files changed

+24
-9
lines changed

stubs/Pillow/PIL/EpsImagePlugin.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from typing import Any, ClassVar
22
from typing_extensions import Literal
33

4+
from ._imaging import PixelAccess
45
from .ImageFile import ImageFile
6+
from .PyAccess import PyAccess
57

68
split: Any
79
field: Any
@@ -24,5 +26,5 @@ class EpsImageFile(ImageFile):
2426
im: Any
2527
mode: Any
2628
tile: Any
27-
def load(self, scale: int = ..., transparency: bool = ...) -> None: ...
29+
def load(self, scale: int = ..., transparency: bool = ...) -> PixelAccess | PyAccess: ...
2830
def load_seek(self, *args, **kwargs) -> None: ...

stubs/Pillow/PIL/GbrImagePlugin.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
from typing import Any, ClassVar
22
from typing_extensions import Literal
33

4+
from ._imaging import PixelAccess
45
from .ImageFile import ImageFile
6+
from .PyAccess import PyAccess
57

68
class GbrImageFile(ImageFile):
79
format: ClassVar[Literal["GBR"]]
810
format_description: ClassVar[str]
911
im: Any
10-
def load(self) -> None: ...
12+
def load(self) -> PixelAccess | PyAccess: ...

stubs/Pillow/PIL/IcnsImagePlugin.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from typing import Any, ClassVar
22
from typing_extensions import Literal
33

4+
from ._imaging import PixelAccess
45
from .ImageFile import ImageFile
6+
from .PyAccess import PyAccess
57

68
enable_jpeg2k: Any
79
HEADERSIZE: int
@@ -32,4 +34,4 @@ class IcnsImageFile(ImageFile):
3234
best_size: Any
3335
im: Any
3436
mode: Any
35-
def load(self) -> None: ...
37+
def load(self) -> PixelAccess | PyAccess: ...

stubs/Pillow/PIL/IcoImagePlugin.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from typing import Any, ClassVar
22
from typing_extensions import Literal
33

4+
from ._imaging import PixelAccess
45
from .ImageFile import ImageFile
6+
from .PyAccess import PyAccess
57

68
class IcoFile:
79
buf: Any
@@ -22,5 +24,5 @@ class IcoImageFile(ImageFile):
2224
def size(self, value) -> None: ...
2325
im: Any
2426
mode: Any
25-
def load(self) -> None: ...
27+
def load(self) -> PixelAccess | PyAccess: ...
2628
def load_seek(self) -> None: ...

stubs/Pillow/PIL/Image.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ from ._imaging import (
1313
FIXED as FIXED,
1414
HUFFMAN_ONLY as HUFFMAN_ONLY,
1515
RLE as RLE,
16+
PixelAccess,
1617
)
1718
from .ImageFilter import Filter
1819
from .ImagePalette import ImagePalette
@@ -180,7 +181,7 @@ class Image:
180181
def tobytes(self, encoder_name: str = ..., *args) -> bytes: ...
181182
def tobitmap(self, name: str = ...) -> bytes: ...
182183
def frombytes(self, data: bytes, decoder_name: str = ..., *args) -> None: ...
183-
def load(self) -> None: ...
184+
def load(self) -> PixelAccess | PyAccess: ...
184185
def verify(self) -> None: ...
185186
def convert(
186187
self,

stubs/Pillow/PIL/ImageFile.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from _typeshed import Incomplete, Self
22
from typing import Any, NoReturn
33

4+
from ._imaging import PixelAccess
45
from .Image import Image
6+
from .PyAccess import PyAccess
57

68
MAXBLOCK: int
79
SAFEBLOCK: Any
@@ -23,12 +25,12 @@ class ImageFile(Image):
2325
def verify(self) -> None: ...
2426
map: Any
2527
im: Any
26-
def load(self): ...
28+
def load(self) -> PixelAccess | PyAccess: ...
2729
def load_prepare(self) -> None: ...
2830
def load_end(self) -> None: ...
2931

3032
class StubImageFile(ImageFile):
31-
def load(self) -> None: ...
33+
def load(self) -> PixelAccess | PyAccess: ...
3234

3335
class Parser:
3436
incremental: Any | None

stubs/Pillow/PIL/WalImageFile.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ from typing import ClassVar
22
from typing_extensions import Literal
33

44
from . import ImageFile
5+
from ._imaging import PixelAccess
6+
from .PyAccess import PyAccess
57

68
class WalImageFile(ImageFile.ImageFile):
79
format: ClassVar[Literal["WAL"]]
810
format_description: ClassVar[str]
9-
def load(self) -> None: ...
11+
def load(self) -> PixelAccess | PyAccess: ...
1012

1113
def open(filename): ...
1214

stubs/Pillow/PIL/WmfImagePlugin.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import sys
22
from typing import Any, ClassVar
33
from typing_extensions import Literal
44

5+
from ._imaging import PixelAccess
56
from .ImageFile import StubImageFile
7+
from .PyAccess import PyAccess
68

79
def register_handler(handler) -> None: ...
810

@@ -15,4 +17,4 @@ if sys.platform == "win32":
1517
class WmfStubImageFile(StubImageFile):
1618
format: ClassVar[Literal["WMF"]]
1719
format_description: ClassVar[str]
18-
def load(self, dpi: Any | None = ...) -> None: ...
20+
def load(self, dpi: Any | None = ...) -> PixelAccess | PyAccess: ...

0 commit comments

Comments
 (0)