We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91337d1 commit a2c1892Copy full SHA for a2c1892
src/zimscraperlib/image/probing.py
@@ -7,6 +7,7 @@
7
import io
8
import pathlib
9
import re
10
+from typing import IO
11
12
import colorthief
13
import PIL.Image
@@ -52,7 +53,7 @@ def is_hex_color(text: str) -> bool:
52
53
54
55
def format_for(
- src: pathlib.Path | io.BytesIO,
56
+ src: pathlib.Path | IO[bytes],
57
from_suffix: bool = True, # noqa: FBT001, FBT002
58
) -> str:
59
"""Pillow format of a given filename, either Pillow-detected or from suffix"""
@@ -70,7 +71,7 @@ def format_for(
70
71
72
73
def is_valid_image(
- image: pathlib.Path | io.IOBase | bytes,
74
+ image: pathlib.Path | IO[bytes] | bytes,
75
imformat: str,
76
size: tuple[int, int] | None = None,
77
) -> bool:
0 commit comments