Improve fpdf.image_parsing (#6313)

* Annotate more attributes, arguments, and return types.
* Add "dims" argument to get_img_info(), added in 2.4.6.
This commit is contained in:
Sebastian Rittau
2021-11-16 17:35:08 +01:00
committed by GitHub
parent bcc743dd2b
commit 1b0e268102

View File

@@ -1,6 +1,11 @@
from typing import Any
from typing import Any, Tuple
from typing_extensions import Literal
SUPPORTED_IMAGE_FILTERS: Any
_ImageFilter = Literal["AUTO", "FlateDecode", "DCTDecode", "JPXDecode"]
SUPPORTED_IMAGE_FILTERS: Tuple[_ImageFilter, ...]
def load_image(filename): ...
def get_img_info(img, image_filter: str = ...): ...
# Returned dict could be typed as a TypedDict.
def get_img_info(img, image_filter: _ImageFilter = ..., dims: Any | None = ...) -> dict[str, Any]: ...