8000 Improve fpdf.image_parsing (#6313) · python/typeshed@1b0e268 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1b0e268

Browse files
authored
Improve fpdf.image_parsing (#6313)
* Annotate more attributes, arguments, and return types. * Add "dims" argument to get_img_info(), added in 2.4.6.
1 parent bcc743d commit 1b0e268

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

stubs/fpdf2/fpdf/image_parsing.pyi

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
from typing import Any
1+
from typing import Any, Tuple
2+
from typing_extensions import Literal
23

3-
SUPPORTED_IMAGE_FILTERS: Any
4+
_ImageFilter = Literal["AUTO", "FlateDecode", "DCTDecode", "JPXDecode"]
5+
6+
SUPPORTED_IMAGE_FILTERS: Tuple[_ImageFilter, ...]
47

58
def load_image(filename): ...
6-
def get_img_info(img, image_filter: str = ...): ...
9+
10+
# Returned dict could be typed as a TypedDict.
11+
def get_img_info(img, image_filter: _ImageFilter = ..., dims: Any | None = ...) -> dict[str, Any]: ...

0 commit comments

Comments
 (0)
0