From d25d12f792c88b3bae881c9090b13d2a9f0e3d84 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 10 Sep 2024 11:29:52 +1000 Subject: [PATCH 1/6] Removed custom build_openjpeg --- .github/workflows/wheels-dependencies.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh index 97f70ed84..9e92e416e 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-1.1.0.tar.gz) From a9b9a63614c7838be9efe421062252c1c8c0546a Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 8 Oct 2024 20:48:32 +1100 Subject: [PATCH 2/6] Do not create core image in seek(), when load() might not run --- src/PIL/TiffImagePlugin.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py index d4c46a797..f3571fda3 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -1193,11 +1193,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: self.fp = self._fp @@ -1279,6 +1279,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) From b5e1115bf2646f7ce5eb1b9409e4540fee3b9f49 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 12 Oct 2024 21:10:47 +1100 Subject: [PATCH 3/6] Update CHANGES.rst [ci skip] --- CHANGES.rst | 9 +++++++++ 1 file changed, 9 insertions(+) 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] From e74994ed370a668c8f3e6045278de5a5eb3f47ab Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:28:41 +0300 Subject: [PATCH 4/6] Update licence to MIT-CMU --- .pre-commit-config.yaml | 1 + pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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/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", From a60610c93f1a7fb2738156470d613793e5fa7a89 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 13 Oct 2024 07:42:17 +1100 Subject: [PATCH 5/6] Added type hints --- src/PIL/ImageMath.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: From c3d81d6375d2d78301a40d0e55ece746cf41502f Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 12 Oct 2024 23:52:57 +0300 Subject: [PATCH 6/6] Update Python 3.13 release date --- docs/releasenotes/11.0.0.rst | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) 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.