Skip to content

Commit

Permalink
Fix type hints detected thanks to PIL update
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Jul 4, 2024
1 parent 91337d1 commit a2c1892
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/zimscraperlib/image/probing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io
import pathlib
import re
from typing import IO

import colorthief
import PIL.Image
Expand Down Expand Up @@ -52,7 +53,7 @@ def is_hex_color(text: str) -> bool:


def format_for(
src: pathlib.Path | io.BytesIO,
src: pathlib.Path | IO[bytes],
from_suffix: bool = True, # noqa: FBT001, FBT002
) -> str:
"""Pillow format of a given filename, either Pillow-detected or from suffix"""
Expand All @@ -70,7 +71,7 @@ def format_for(


def is_valid_image(
image: pathlib.Path | io.IOBase | bytes,
image: pathlib.Path | IO[bytes] | bytes,
imformat: str,
size: tuple[int, int] | None = None,
) -> bool:
Expand Down

0 comments on commit a2c1892

Please sign in to comment.