mirror of
https://github.com/wiltodelta/remove-ai-watermarks.git
synced 2026-07-06 00:17:50 +02:00
888c8c2556
Make `pyright src/` strict-clean via a hybrid: pure-logic files are fully typed (piexif gets a local typings/ stub; PIL info-dict loops guard isinstance(key, str); progress returns Callable[..., None]; availability checks use importlib.util.find_spec instead of unused imports), while the irreducibly-untyped cv2/torch/diffusers boundary files carry a documented per-file `# pyright:` relax pragma (or a ctrlregen executionEnvironment) that disables only the unknown-type rules. Public ndarray-returning signatures on the relaxed engines are annotated NDArray[Any] so strict consumers (cli.py) stay clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
24 lines
801 B
Python
24 lines
801 B
Python
"""Minimal local type stub for the untyped ``piexif`` package.
|
|
|
|
Covers only the API surface used in this repo (``load``/``dump`` plus the
|
|
``ImageIFD`` tag ids), so strict pyright resolves the otherwise-Unknown values
|
|
that ``piexif.load`` returns instead of carrying type debt. piexif ships no
|
|
``py.typed`` marker; extend this stub if new piexif APIs are adopted.
|
|
"""
|
|
|
|
from typing import Any
|
|
|
|
class ImageIFD:
|
|
Software: int
|
|
Make: int
|
|
Artist: int
|
|
ImageDescription: int
|
|
|
|
class ExifIFD: ...
|
|
class GPSIFD: ...
|
|
|
|
def load(input_data: bytes | str, key_is_name: bool = ...) -> dict[str, Any]: ...
|
|
def dump(exif_dict_original: dict[str, Any]) -> bytes: ...
|
|
def insert(exif: bytes, image: str, new_file: str | None = ...) -> None: ...
|
|
def remove(src: str, new_file: str | None = ...) -> None: ...
|