diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh index 19eb91cbb..97c1adf09 100755 --- a/.github/workflows/wheels-dependencies.sh +++ b/.github/workflows/wheels-dependencies.sh @@ -38,16 +38,6 @@ BZIP2_VERSION=1.0.8 LIBXCB_VERSION=1.17.0 BROTLI_VERSION=1.1.0 -if [[ -n "$IS_MACOS" ]] && [[ "$CIBW_ARCHS" == "x86_64" ]]; then - function build_openjpeg { - local out_dir=$(fetch_unpack https://github.com/uclouvain/openjpeg/archive/v$OPENJPEG_VERSION.tar.gz openjpeg-$OPENJPEG_VERSION.tar.gz) - (cd $out_dir \ - && cmake -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX -DCMAKE_INSTALL_NAME_DIR=$BUILD_PREFIX/lib . \ - && make install) - touch openjpeg-stamp - } -fi - function build_brotli { local cmake=$(get_modern_cmake) local out_dir=$(fetch_unpack https://github.com/google/brotli/archive/v$BROTLI_VERSION.tar.gz brotli-$BROTLI_VERSION.tar.gz) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bdc335f32..6254b8941 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -70,6 +70,7 @@ repos: rev: v0.20.2 hooks: - id: validate-pyproject + additional_dependencies: [trove-classifiers>=2024.10.12] - repo: https://github.com/tox-dev/tox-ini-fmt rev: 1.4.1 diff --git a/CHANGES.rst b/CHANGES.rst index c965d60a6..0a1703668 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,15 @@ Changelog (Pillow) 11.0.0 (unreleased) ------------------- +- Conditionally define ImageCms type hint to avoid requiring core #8197 + [radarhere] + +- Support writing LONG8 offsets in AppendingTiffWriter #8417 + [radarhere] + +- Use ImageFile.MAXBLOCK when saving TIFF images #8461 + [radarhere] + - Do not close provided file handles with libtiff when saving #8458 [radarhere] diff --git a/docs/releasenotes/11.0.0.rst b/docs/releasenotes/11.0.0.rst index d5f5934f4..c3f18140f 100644 --- a/docs/releasenotes/11.0.0.rst +++ b/docs/releasenotes/11.0.0.rst @@ -1,19 +1,6 @@ 11.0.0 ------ -Security -======== - -TODO -^^^^ - -TODO - -:cve:`YYYY-XXXXX`: TODO -^^^^^^^^^^^^^^^^^^^^^^^ - -TODO - Backwards Incompatible Changes ============================== @@ -159,7 +146,7 @@ Python 3.13 Pillow 10.4.0 had wheels built against Python 3.13 beta, available as a preview to help others prepare for 3.13, and to ensure Pillow could be used immediately at the release -of 3.13.0 final (2024-10-01, :pep:`719`). +of 3.13.0 final (2024-10-07, :pep:`719`). Pillow 11.0.0 now officially supports Python 3.13. diff --git a/pyproject.toml b/pyproject.toml index 132030c99..c55be7693 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,14 +14,14 @@ readme = "README.md" keywords = [ "Imaging", ] -license = { text = "HPND" } +license = { text = "MIT-CMU" } authors = [ { name = "Jeffrey A. Clark", email = "aclark@aclark.net" }, ] requires-python = ">=3.9" classifiers = [ "Development Status :: 6 - Mature", - "License :: OSI Approved :: Historical Permission Notice and Disclaimer (HPND)", + "License :: OSI Approved :: CMU License (MIT-CMU)", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/src/PIL/ImageMath.py b/src/PIL/ImageMath.py index 15464947d..484797f91 100644 --- a/src/PIL/ImageMath.py +++ b/src/PIL/ImageMath.py @@ -173,10 +173,10 @@ class _Operand: return self.apply("rshift", self, other) # logical - def __eq__(self, other): + def __eq__(self, other: _Operand | float) -> _Operand: # type: ignore[override] return self.apply("eq", self, other) - def __ne__(self, other): + def __ne__(self, other: _Operand | float) -> _Operand: # type: ignore[override] return self.apply("ne", self, other) def __lt__(self, other: _Operand | float) -> _Operand: diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py index 5c50e2efd..500c2c65f 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -1194,11 +1194,11 @@ class TiffImageFile(ImageFile.ImageFile): if not self._seek_check(frame): return self._seek(frame) - # Create a new core image object on second and - # subsequent frames in the image. Image may be - # different size/mode. - Image._decompression_bomb_check(self._tile_size) - self.im = Image.core.new(self.mode, self._tile_size) + if self._im is not None and ( + self.im.size != self._tile_size or self.im.mode != self.mode + ): + # The core image will no longer be used + self._im = None def _seek(self, frame: int) -> None: if isinstance(self._fp, DeferredError): @@ -1282,6 +1282,7 @@ class TiffImageFile(ImageFile.ImageFile): def load_prepare(self) -> None: if self._im is None: + Image._decompression_bomb_check(self._tile_size) self.im = Image.core.new(self.mode, self._tile_size) ImageFile.ImageFile.load_prepare(self)