diff --git a/stubs/Pillow/PIL/Image.pyi b/stubs/Pillow/PIL/Image.pyi index 9aeabdb06..14c95dad8 100644 --- a/stubs/Pillow/PIL/Image.pyi +++ b/stubs/Pillow/PIL/Image.pyi @@ -3,7 +3,7 @@ from collections.abc import Callable, Iterable, Iterator, MutableMapping, Sequen from enum import IntEnum from pathlib import Path from typing import Any, ClassVar, Protocol, SupportsBytes -from typing_extensions import Final, Literal, Self, TypeAlias, TypeGuard +from typing_extensions import Literal, Self, TypeAlias, TypeGuard from PIL.PyAccess import PyAccess @@ -39,7 +39,12 @@ class _Writeable(SupportsWrite[bytes], Protocol): class DecompressionBombWarning(RuntimeWarning): ... class DecompressionBombError(Exception): ... -MAX_IMAGE_PIXELS: Final[int] +# Despite the ALL_CAPS spelling, Pillow's docs mention that this threshold can +# be altered at runtime. See +# https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.open +# or the permalink +# https://github.com/python-pillow/Pillow/blob/10.0.0/docs/reference/Image.rst?plain=1#L54-L55 +MAX_IMAGE_PIXELS: int | None USE_CFFI_ACCESS: bool