From 327e13ffd0d4999fb9cd63d12407f08f20710677 Mon Sep 17 00:00:00 2001
From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Date: Sun, 6 Oct 2024 00:57:58 +0300
Subject: [PATCH 01/10] Stop testing on AppVeyor
---
.appveyor.yml | 99 -----------------------------------------
.github/CONTRIBUTING.md | 4 +-
.github/mergify.yml | 1 -
MANIFEST.in | 1 -
README.md | 3 --
RELEASING.md | 4 +-
Tests/helper.py | 9 ----
docs/about.rst | 3 +-
docs/index.rst | 4 --
winbuild/README.md | 4 +-
winbuild/build.rst | 4 +-
11 files changed, 9 insertions(+), 127 deletions(-)
delete mode 100644 .appveyor.yml
diff --git a/.appveyor.yml b/.appveyor.yml
deleted file mode 100644
index 781ad4a4b..000000000
--- a/.appveyor.yml
+++ /dev/null
@@ -1,99 +0,0 @@
-skip_commits:
- files:
- - ".github/**/*"
- - ".gitmodules"
- - "docs/**/*"
- - "wheels/**/*"
-
-version: '{build}'
-clone_folder: c:\pillow
-init:
-- ECHO %PYTHON%
-#- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
-# Uncomment previous line to get RDP access during the build.
-
-environment:
- COVERAGE_CORE: sysmon
- EXECUTABLE: python.exe
- TEST_OPTIONS:
- DEPLOY: YES
- matrix:
- - PYTHON: C:/Python313
- ARCHITECTURE: x86
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
- - PYTHON: C:/Python39-x64
- ARCHITECTURE: AMD64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
-
-
-install:
-- '%PYTHON%\%EXECUTABLE% --version'
-- '%PYTHON%\%EXECUTABLE% -m pip install --upgrade pip'
-- curl -fsSL -o pillow-test-images.zip https://github.com/python-pillow/test-images/archive/main.zip
-- 7z x pillow-test-images.zip -oc:\
-- xcopy /S /Y c:\test-images-main\* c:\pillow\tests\images
-- curl -fsSL -o nasm-win64.zip https://raw.githubusercontent.com/python-pillow/pillow-depends/main/nasm-2.16.03-win64.zip
-- 7z x nasm-win64.zip -oc:\
-- choco install ghostscript --version=10.4.0
-- path c:\nasm-2.16.03;C:\Program Files\gs\gs10.04.0\bin;%PATH%
-- cd c:\pillow\winbuild\
-- ps: |
- c:\python39\python.exe c:\pillow\winbuild\build_prepare.py -v --depends=C:\pillow-depends\
- c:\pillow\winbuild\build\build_dep_all.cmd
- $host.SetShouldExit(0)
-- path C:\pillow\winbuild\build\bin;%PATH%
-
-build_script:
-- cd c:\pillow
-- winbuild\build\build_env.cmd
-- '%PYTHON%\%EXECUTABLE% -m pip install -v -C raqm=vendor -C fribidi=vendor .'
-- '%PYTHON%\%EXECUTABLE% selftest.py --installed'
-
-test_script:
-- cd c:\pillow
-- '%PYTHON%\%EXECUTABLE% -m pip install pytest pytest-cov pytest-timeout defusedxml ipython numpy olefile pyroma'
-- c:\"Program Files (x86)"\"Windows Kits"\10\Debuggers\x86\gflags.exe /p /enable %PYTHON%\%EXECUTABLE%
-- path %PYTHON%;%PATH%
-- .ci\test.cmd
-
-after_test:
-- curl -Os https://uploader.codecov.io/latest/windows/codecov.exe
-- .\codecov.exe --file coverage.xml --name %PYTHON% --flags AppVeyor
-
-matrix:
- fast_finish: true
-
-cache:
-- '%LOCALAPPDATA%\pip\Cache'
-
-artifacts:
-- path: pillow\*.egg
- name: egg
-- path: pillow\*.whl
- name: wheel
-
-before_deploy:
- - cd c:\pillow
- - '%PYTHON%\%EXECUTABLE% -m pip wheel -v -C raqm=vendor -C fribidi=vendor .'
- - ps: Get-ChildItem .\*.whl | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
-
-deploy:
- provider: S3
- region: us-west-2
- access_key_id: AKIAIRAXC62ZNTVQJMOQ
- secret_access_key:
- secure: Hwb6klTqtBeMgxAjRoDltiiqpuH8xbwD4UooDzBSiCWXjuFj1lyl4kHgHwTCCGqi
- bucket: pillow-nightly
- folder: win/$(APPVEYOR_BUILD_NUMBER)/
- artifact: /.*egg|wheel/
- on:
- APPVEYOR_REPO_NAME: python-pillow/Pillow
- branch: main
- deploy: YES
-
-
-# Uncomment the following lines to get RDP access after the build/test and block for
-# up to the timeout limit (~1hr)
-#
-#on_finish:
-#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index d03fcf0d9..c372da7d2 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -9,7 +9,7 @@ Please send a pull request to the `main` branch. Please include [documentation](
- Fork the Pillow repository.
- Create a branch from `main`.
- Develop bug fixes, features, tests, etc.
-- Run the test suite. You can enable GitHub Actions (https://github.com/MY-USERNAME/Pillow/actions) and [AppVeyor](https://ci.appveyor.com/projects/new) on your repo to catch test failures prior to the pull request, and [Codecov](https://codecov.io/gh) to see if the changed code is covered by tests.
+- Run the test suite. You can enable GitHub Actions (https://github.com/MY-USERNAME/Pillow/actions) on your repo to catch test failures prior to the pull request, and [Codecov](https://codecov.io/gh) to see if the changed code is covered by tests.
- Create a pull request to pull the changes from your branch to the Pillow `main`.
### Guidelines
@@ -17,7 +17,7 @@ Please send a pull request to the `main` branch. Please include [documentation](
- Separate code commits from reformatting commits.
- Provide tests for any newly added code.
- Follow PEP 8.
-- When committing only documentation changes please include `[ci skip]` in the commit message to avoid running tests on AppVeyor.
+- When committing only documentation changes please include `[ci skip]` in the commit message to avoid running extra tests.
- Include [release notes](https://github.com/python-pillow/Pillow/tree/main/docs/releasenotes) as needed or appropriate with your bug fixes, feature additions and tests.
- Do not add to the [changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst) for proposed changes, as that is updated after changes are merged.
diff --git a/.github/mergify.yml b/.github/mergify.yml
index 3c2066137..9bb089615 100644
--- a/.github/mergify.yml
+++ b/.github/mergify.yml
@@ -9,7 +9,6 @@ pull_request_rules:
- status-success=Windows Test Successful
- status-success=MinGW
- status-success=Cygwin Test Successful
- - status-success=continuous-integration/appveyor/pr
actions:
merge:
method: merge
diff --git a/MANIFEST.in b/MANIFEST.in
index af25dfd2d..48085b82e 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -20,7 +20,6 @@ graft docs
graft _custom_build
# build/src control detritus
-exclude .appveyor.yml
exclude .clang-format
exclude .coveragerc
exclude .editorconfig
diff --git a/README.md b/README.md
index 5bbebaccb..c6e61453f 100644
--- a/README.md
+++ b/README.md
@@ -42,9 +42,6 @@ As of 2019, Pillow development is
-
diff --git a/RELEASING.md b/RELEASING.md
index 9e6ec5dd4..490f6d6bd 100644
--- a/RELEASING.md
+++ b/RELEASING.md
@@ -9,7 +9,7 @@ Released quarterly on January 2nd, April 1st, July 1st and October 15th.
* [ ] Open a release ticket e.g. https://github.com/python-pillow/Pillow/issues/3154
* [ ] Develop and prepare release in `main` branch.
-* [ ] Check [GitHub Actions](https://github.com/python-pillow/Pillow/actions) and [AppVeyor](https://ci.appveyor.com/project/python-pillow/Pillow) to confirm passing tests in `main` branch.
+* [ ] Check [GitHub Actions](https://github.com/python-pillow/Pillow/actions) to confirm passing tests in `main` branch.
* [ ] Check that all the wheel builds pass the tests in the [GitHub Actions "Wheels" workflow](https://github.com/python-pillow/Pillow/actions/workflows/wheels.yml) jobs by manually triggering them.
* [ ] In compliance with [PEP 440](https://peps.python.org/pep-0440/), update version identifier in `src/PIL/_version.py`
* [ ] Update `CHANGES.rst`.
@@ -40,7 +40,7 @@ Released as needed for security, installation or critical bug fixes.
git checkout -t remotes/origin/5.2.x
```
* [ ] Cherry pick individual commits from `main` branch to release branch e.g. `5.2.x`, then `git push`.
-* [ ] Check [GitHub Actions](https://github.com/python-pillow/Pillow/actions) and [AppVeyor](https://ci.appveyor.com/project/python-pillow/Pillow) to confirm passing tests in release branch e.g. `5.2.x`.
+* [ ] Check [GitHub Actions](https://github.com/python-pillow/Pillow/actions) to confirm passing tests in release branch e.g. `5.2.x`.
* [ ] In compliance with [PEP 440](https://peps.python.org/pep-0440/), update version identifier in `src/PIL/_version.py`
* [ ] Run pre-release check via `make release-test`.
* [ ] Create tag for release e.g.:
diff --git a/Tests/helper.py b/Tests/helper.py
index d6a93a803..cf1ef1997 100644
--- a/Tests/helper.py
+++ b/Tests/helper.py
@@ -327,16 +327,7 @@ def magick_command() -> list[str] | None:
return None
-def on_appveyor() -> bool:
- return "APPVEYOR" in os.environ
-
-
-def on_github_actions() -> bool:
- return "GITHUB_ACTIONS" in os.environ
-
-
def on_ci() -> bool:
- # GitHub Actions and AppVeyor have "CI"
return "CI" in os.environ
diff --git a/docs/about.rst b/docs/about.rst
index c51ddebd0..7df895b8f 100644
--- a/docs/about.rst
+++ b/docs/about.rst
@@ -6,12 +6,11 @@ Goals
The fork author's goal is to foster and support active development of PIL through:
-- Continuous integration testing via `GitHub Actions`_ and `AppVeyor`_
+- Continuous integration testing via `GitHub Actions`_
- Publicized development activity on `GitHub`_
- Regular releases to the `Python Package Index`_
.. _GitHub Actions: https://github.com/python-pillow/Pillow/actions
-.. _AppVeyor: https://ci.appveyor.com/project/Python-pillow/pillow
.. _GitHub: https://github.com/python-pillow/Pillow
.. _Python Package Index: https://pypi.org/project/pillow/
diff --git a/docs/index.rst b/docs/index.rst
index 18f5c3d13..689088d48 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -33,10 +33,6 @@ Pillow for enterprise is available via the Tidelift Subscription. `Learn more
Date: Sun, 6 Oct 2024 20:16:55 +0300
Subject: [PATCH 02/10] Test the oldest Python on 32-bit Windows 2019
---
.github/workflows/test-windows.yml | 14 ++++++++++----
docs/installation/platform-support.rst | 4 +---
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml
index f6d0aeb1d..2e76c05ae 100644
--- a/.github/workflows/test-windows.yml
+++ b/.github/workflows/test-windows.yml
@@ -31,15 +31,20 @@ env:
jobs:
build:
- runs-on: windows-latest
+ runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
- python-version: ["pypy3.10", "3.9", "3.10", "3.11", "3.12", "3.13"]
+ python-version: ["pypy3.10", "3.10", "3.11", "3.12", "3.13"]
+ architecture: ["x64"]
+ os: ["windows-latest"]
+ include:
+ # Test the oldest Python on 32-bit
+ - { python-version: "3.9", architecture: "x86", os: "windows-2019" }
timeout-minutes: 30
- name: Python ${{ matrix.python-version }}
+ name: Python ${{ matrix.python-version }} (${{ matrix.architecture }})
steps:
- name: Checkout Pillow
@@ -63,6 +68,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
+ architecture: ${{ matrix.architecture }}
cache: pip
cache-dependency-path: ".github/workflows/test-windows.yml"
@@ -81,7 +87,7 @@ jobs:
pytest-timeout
- name: Install CPython dependencies
- if: "!contains(matrix.python-version, 'pypy')"
+ if: "!contains(matrix.python-version, 'pypy') && matrix.architecture != 'x86'"
run: >
python3 -m pip install
PyQt6
diff --git a/docs/installation/platform-support.rst b/docs/installation/platform-support.rst
index a0bada7b4..cd196e4f8 100644
--- a/docs/installation/platform-support.rst
+++ b/docs/installation/platform-support.rst
@@ -48,13 +48,11 @@ These platforms are built and tested for every change.
| Ubuntu Linux 24.04 LTS (Noble) | 3.12 | x86-64, ppc64le, |
| | | s390x |
+----------------------------------+----------------------------+---------------------+
-| Windows Server 2019 | 3.9 | x86-64 |
+| Windows Server 2019 | 3.9 | x86 |
+----------------------------------+----------------------------+---------------------+
| Windows Server 2022 | 3.9, 3.10, 3.11, | x86-64 |
| | 3.12, 3.13, PyPy3 | |
| +----------------------------+---------------------+
-| | 3.13 | x86 |
-| +----------------------------+---------------------+
| | 3.9 (MinGW) | x86-64 |
| +----------------------------+---------------------+
| | 3.9 (Cygwin) | x86-64 |
From a262b1991b439574578b60fac932b7065e02f0b6 Mon Sep 17 00:00:00 2001
From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Date: Thu, 7 Nov 2024 12:54:28 +0200
Subject: [PATCH 03/10] Update winbuild/README.md
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
---
winbuild/README.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/winbuild/README.md b/winbuild/README.md
index 0d3ec8d8a..c474f12ce 100644
--- a/winbuild/README.md
+++ b/winbuild/README.md
@@ -11,7 +11,8 @@ For more extensive info, see the [Windows build instructions](build.rst).
* Requires Microsoft Visual Studio 2017 or newer with C++ component.
* Requires NASM for libjpeg-turbo, a required dependency when using this script.
* Requires CMake 3.15 or newer (available as Visual Studio component).
-* Tested on Windows Server 2022 with Visual Studio 2022 Enterprise (GitHub Actions).
+* Tested on Windows Server 2022 with Visual Studio 2022 Enterprise and Windows Server
+ 2019 with Visual Studio 2019 Enterprise (GitHub Actions).
Here's an example script to build on Windows:
From 09bf28e9d7dbe20c13dc05ebe62a9e706abd273c Mon Sep 17 00:00:00 2001
From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Date: Thu, 7 Nov 2024 15:46:08 +0200
Subject: [PATCH 04/10] Update platform support
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
---
docs/installation/platform-support.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/installation/platform-support.rst b/docs/installation/platform-support.rst
index 4e8620fc4..373708a61 100644
--- a/docs/installation/platform-support.rst
+++ b/docs/installation/platform-support.rst
@@ -50,8 +50,8 @@ These platforms are built and tested for every change.
+----------------------------------+----------------------------+---------------------+
| Windows Server 2019 | 3.9 | x86 |
+----------------------------------+----------------------------+---------------------+
-| Windows Server 2022 | 3.9, 3.10, 3.11, | x86-64 |
-| | 3.12, 3.13, PyPy3 | |
+| Windows Server 2022 | 3.10, 3.11, 3.12, 3.13, | x86-64 |
+| | PyPy3 | |
| +----------------------------+---------------------+
| | 3.9 (MinGW) | x86-64 |
| +----------------------------+---------------------+
From 5ad98e7abb19710cfb0c6c70ad52b543b1c5769b Mon Sep 17 00:00:00 2001
From: Andrew Murray
Date: Mon, 13 Jan 2025 07:54:43 +1100
Subject: [PATCH 05/10] Moved get_child_images()
---
src/PIL/Image.py | 46 ------------------------------------------
src/PIL/ImageFile.py | 48 +++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 47 insertions(+), 47 deletions(-)
diff --git a/src/PIL/Image.py b/src/PIL/Image.py
index dff3d063b..0648161be 100644
--- a/src/PIL/Image.py
+++ b/src/PIL/Image.py
@@ -1553,52 +1553,6 @@ class Image:
self._exif._loaded = False
self.getexif()
- def get_child_images(self) -> list[ImageFile.ImageFile]:
- child_images = []
- exif = self.getexif()
- ifds = []
- if ExifTags.Base.SubIFDs in exif:
- subifd_offsets = exif[ExifTags.Base.SubIFDs]
- if subifd_offsets:
- if not isinstance(subifd_offsets, tuple):
- subifd_offsets = (subifd_offsets,)
- for subifd_offset in subifd_offsets:
- ifds.append((exif._get_ifd_dict(subifd_offset), subifd_offset))
- ifd1 = exif.get_ifd(ExifTags.IFD.IFD1)
- if ifd1 and ifd1.get(ExifTags.Base.JpegIFOffset):
- assert exif._info is not None
- ifds.append((ifd1, exif._info.next))
-
- offset = None
- for ifd, ifd_offset in ifds:
- current_offset = self.fp.tell()
- if offset is None:
- offset = current_offset
-
- fp = self.fp
- if ifd is not None:
- thumbnail_offset = ifd.get(ExifTags.Base.JpegIFOffset)
- if thumbnail_offset is not None:
- thumbnail_offset += getattr(self, "_exif_offset", 0)
- self.fp.seek(thumbnail_offset)
- data = self.fp.read(ifd.get(ExifTags.Base.JpegIFByteCount))
- fp = io.BytesIO(data)
-
- with open(fp) as im:
- from . import TiffImagePlugin
-
- if thumbnail_offset is None and isinstance(
- im, TiffImagePlugin.TiffImageFile
- ):
- im._frame_pos = [ifd_offset]
- im._seek(0)
- im.load()
- child_images.append(im)
-
- if offset is not None:
- self.fp.seek(offset)
- return child_images
-
def getim(self) -> CapsuleType:
"""
Returns a capsule that points to the internal image memory.
diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py
index 5d0f87a9f..b2a44cb4d 100644
--- a/src/PIL/ImageFile.py
+++ b/src/PIL/ImageFile.py
@@ -36,7 +36,7 @@ import struct
import sys
from typing import IO, TYPE_CHECKING, Any, NamedTuple, cast
-from . import Image
+from . import ExifTags, Image
from ._deprecate import deprecate
from ._util import is_path
@@ -163,6 +163,52 @@ class ImageFile(Image.Image):
def _open(self) -> None:
pass
+ def get_child_images(self) -> list[ImageFile]:
+ child_images = []
+ exif = self.getexif()
+ ifds = []
+ if ExifTags.Base.SubIFDs in exif:
+ subifd_offsets = exif[ExifTags.Base.SubIFDs]
+ if subifd_offsets:
+ if not isinstance(subifd_offsets, tuple):
+ subifd_offsets = (subifd_offsets,)
+ for subifd_offset in subifd_offsets:
+ ifds.append((exif._get_ifd_dict(subifd_offset), subifd_offset))
+ ifd1 = exif.get_ifd(ExifTags.IFD.IFD1)
+ if ifd1 and ifd1.get(ExifTags.Base.JpegIFOffset):
+ assert exif._info is not None
+ ifds.append((ifd1, exif._info.next))
+
+ offset = None
+ for ifd, ifd_offset in ifds:
+ current_offset = self.fp.tell()
+ if offset is None:
+ offset = current_offset
+
+ fp = self.fp
+ if ifd is not None:
+ thumbnail_offset = ifd.get(ExifTags.Base.JpegIFOffset)
+ if thumbnail_offset is not None:
+ thumbnail_offset += getattr(self, "_exif_offset", 0)
+ self.fp.seek(thumbnail_offset)
+ data = self.fp.read(ifd.get(ExifTags.Base.JpegIFByteCount))
+ fp = io.BytesIO(data)
+
+ with Image.open(fp) as im:
+ from . import TiffImagePlugin
+
+ if thumbnail_offset is None and isinstance(
+ im, TiffImagePlugin.TiffImageFile
+ ):
+ im._frame_pos = [ifd_offset]
+ im._seek(0)
+ im.load()
+ child_images.append(im)
+
+ if offset is not None:
+ self.fp.seek(offset)
+ return child_images
+
def get_format_mimetype(self) -> str | None:
if self.custom_mimetype:
return self.custom_mimetype
From 34762ded7500a20f938f98250df6e650608cd57e Mon Sep 17 00:00:00 2001
From: Andrew Murray
Date: Mon, 13 Jan 2025 07:57:28 +1100
Subject: [PATCH 06/10] Assert JpegIFByteCount is int
---
src/PIL/ImageFile.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py
index b2a44cb4d..f905b34b6 100644
--- a/src/PIL/ImageFile.py
+++ b/src/PIL/ImageFile.py
@@ -191,7 +191,10 @@ class ImageFile(Image.Image):
if thumbnail_offset is not None:
thumbnail_offset += getattr(self, "_exif_offset", 0)
self.fp.seek(thumbnail_offset)
- data = self.fp.read(ifd.get(ExifTags.Base.JpegIFByteCount))
+
+ length = ifd.get(ExifTags.Base.JpegIFByteCount)
+ assert isinstance(length, int)
+ data = self.fp.read(length)
fp = io.BytesIO(data)
with Image.open(fp) as im:
From a922126ed7495466b2193c6cf582ade11f0f8fe5 Mon Sep 17 00:00:00 2001
From: Andrew Murray
Date: Mon, 13 Jan 2025 07:57:50 +1100
Subject: [PATCH 07/10] Assert fp is not None
---
src/PIL/ImageFile.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py
index f905b34b6..3476e48ff 100644
--- a/src/PIL/ImageFile.py
+++ b/src/PIL/ImageFile.py
@@ -180,6 +180,7 @@ class ImageFile(Image.Image):
ifds.append((ifd1, exif._info.next))
offset = None
+ assert self.fp is not None
for ifd, ifd_offset in ifds:
current_offset = self.fp.tell()
if offset is None:
From a04e76a84ff7122de52ad381e1d44dc556040c36 Mon Sep 17 00:00:00 2001
From: Andrew Murray
Date: Fri, 17 Jan 2025 11:51:21 +1100
Subject: [PATCH 08/10] Use arm64 Linux runners
---
.github/workflows/wheels.yml | 71 +++++++-----------------------------
1 file changed, 13 insertions(+), 58 deletions(-)
diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml
index fd89f7585..0402f1b54 100644
--- a/.github/workflows/wheels.yml
+++ b/.github/workflows/wheels.yml
@@ -42,62 +42,7 @@ env:
FORCE_COLOR: 1
jobs:
- build-1-QEMU-emulated-wheels:
- if: github.event_name != 'schedule'
- name: aarch64 ${{ matrix.python-version }} ${{ matrix.spec }}
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- python-version:
- - pp310
- - cp3{9,10,11}
- - cp3{12,13}
- spec:
- - manylinux2014
- - manylinux_2_28
- - musllinux
- exclude:
- - { python-version: pp310, spec: musllinux }
-
- steps:
- - uses: actions/checkout@v4
- with:
- persist-credentials: false
- submodules: true
-
- - uses: actions/setup-python@v5
- with:
- python-version: "3.x"
-
- # https://github.com/docker/setup-qemu-action
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v3
-
- - name: Install cibuildwheel
- run: |
- python3 -m pip install -r .ci/requirements-cibw.txt
-
- - name: Build wheels
- run: |
- python3 -m cibuildwheel --output-dir wheelhouse
- env:
- # Build only the currently selected Linux architecture (so we can
- # parallelise for speed).
- CIBW_ARCHS: "aarch64"
- # Likewise, select only one Python version per job to speed this up.
- CIBW_BUILD: "${{ matrix.python-version }}-${{ matrix.spec == 'musllinux' && 'musllinux' || 'manylinux' }}*"
- CIBW_ENABLE: cpython-prerelease
- # Extra options for manylinux.
- CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.spec }}
- CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: ${{ matrix.spec }}
-
- - uses: actions/upload-artifact@v4
- with:
- name: dist-qemu-${{ matrix.python-version }}-${{ matrix.spec }}
- path: ./wheelhouse/*.whl
-
- build-2-native-wheels:
+ build-native-wheels:
if: github.event_name != 'schedule' || github.repository_owner == 'python-pillow'
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
@@ -132,6 +77,14 @@ jobs:
cibw_arch: x86_64
build: "*manylinux*"
manylinux: "manylinux_2_28"
+ - name: "manylinux2014 and musllinux aarch64"
+ os: ubuntu-24.04-arm
+ cibw_arch: aarch64
+ - name: "manylinux_2_28 aarch64"
+ os: ubuntu-24.04-arm
+ cibw_arch: aarch64
+ build: "*manylinux*"
+ manylinux: "manylinux_2_28"
steps:
- uses: actions/checkout@v4
with:
@@ -153,6 +106,8 @@ jobs:
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_BUILD: ${{ matrix.build }}
CIBW_ENABLE: cpython-prerelease cpython-freethreading
+ CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux }}
+ CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: ${{ matrix.manylinux }}
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ${{ matrix.manylinux }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux }}
CIBW_SKIP: pp39-*
@@ -275,7 +230,7 @@ jobs:
scientific-python-nightly-wheels-publish:
if: github.repository_owner == 'python-pillow' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
- needs: [build-2-native-wheels, windows]
+ needs: [build-native-wheels, windows]
runs-on: ubuntu-latest
name: Upload wheels to scientific-python-nightly-wheels
steps:
@@ -292,7 +247,7 @@ jobs:
pypi-publish:
if: github.repository_owner == 'python-pillow' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
- needs: [build-1-QEMU-emulated-wheels, build-2-native-wheels, windows, sdist]
+ needs: [build-native-wheels, windows, sdist]
runs-on: ubuntu-latest
name: Upload release to PyPI
environment:
From 176c5b3749fe4642186dceb4c4253e4cd3e60e03 Mon Sep 17 00:00:00 2001
From: Andrew Murray
Date: Fri, 17 Jan 2025 11:51:42 +1100
Subject: [PATCH 09/10] Added pypy to CIBW_ENABLE
---
.github/workflows/wheels.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml
index 0402f1b54..db8e4d58b 100644
--- a/.github/workflows/wheels.yml
+++ b/.github/workflows/wheels.yml
@@ -105,7 +105,7 @@ jobs:
env:
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_BUILD: ${{ matrix.build }}
- CIBW_ENABLE: cpython-prerelease cpython-freethreading
+ CIBW_ENABLE: cpython-prerelease cpython-freethreading pypy
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux }}
CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: ${{ matrix.manylinux }}
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ${{ matrix.manylinux }}
@@ -184,7 +184,7 @@ jobs:
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_BEFORE_ALL: "{package}\\winbuild\\build\\build_dep_all.cmd"
CIBW_CACHE_PATH: "C:\\cibw"
- CIBW_ENABLE: cpython-prerelease cpython-freethreading
+ CIBW_ENABLE: cpython-prerelease cpython-freethreading pypy
CIBW_SKIP: pp39-*
CIBW_TEST_SKIP: "*-win_arm64"
CIBW_TEST_COMMAND: 'docker run --rm
From be8e55d28d3525b05769aee5f36b945bd6e01f77 Mon Sep 17 00:00:00 2001
From: Andrew Murray
Date: Fri, 17 Jan 2025 18:34:23 +1100
Subject: [PATCH 10/10] Added deprecation warning
---
Tests/test_image.py | 5 ++++
docs/deprecations.rst | 10 +++++++
docs/releasenotes/11.2.0.rst | 58 ++++++++++++++++++++++++++++++++++++
docs/releasenotes/index.rst | 1 +
src/PIL/Image.py | 6 ++++
src/PIL/ImageFile.py | 3 +-
src/PIL/_deprecate.py | 2 ++
7 files changed, 84 insertions(+), 1 deletion(-)
create mode 100644 docs/releasenotes/11.2.0.rst
diff --git a/Tests/test_image.py b/Tests/test_image.py
index fe43cea40..108013463 100644
--- a/Tests/test_image.py
+++ b/Tests/test_image.py
@@ -989,6 +989,11 @@ class TestImage:
else:
assert im.getxmp() == {"xmpmeta": None}
+ def test_get_child_images(self) -> None:
+ im = Image.new("RGB", (1, 1))
+ with pytest.warns(DeprecationWarning):
+ assert im.get_child_images() == []
+
@pytest.mark.parametrize("size", ((1, 0), (0, 1), (0, 0)))
def test_zero_tobytes(self, size: tuple[int, int]) -> None:
im = Image.new("RGB", size)
diff --git a/docs/deprecations.rst b/docs/deprecations.rst
index 80966ca36..634cee689 100644
--- a/docs/deprecations.rst
+++ b/docs/deprecations.rst
@@ -183,6 +183,16 @@ ExifTags.IFD.Makernote
``ExifTags.IFD.Makernote`` has been deprecated. Instead, use
``ExifTags.IFD.MakerNote``.
+Image.Image.get_child_images()
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. deprecated:: 11.2.0
+
+``Image.Image.get_child_images()`` has been deprecated. and will be removed in Pillow
+13 (2026-10-15). It will be moved to ``ImageFile.ImageFile.get_child_images()``. The
+method uses an image's file pointer, and so child images could only be retrieved from
+an :py:class:`PIL.ImageFile.ImageFile` instance.
+
Removed features
----------------
diff --git a/docs/releasenotes/11.2.0.rst b/docs/releasenotes/11.2.0.rst
new file mode 100644
index 000000000..025b64660
--- /dev/null
+++ b/docs/releasenotes/11.2.0.rst
@@ -0,0 +1,58 @@
+11.2.0
+------
+
+Security
+========
+
+TODO
+^^^^
+
+TODO
+
+:cve:`YYYY-XXXXX`: TODO
+^^^^^^^^^^^^^^^^^^^^^^^
+
+TODO
+
+Backwards Incompatible Changes
+==============================
+
+TODO
+^^^^
+
+Deprecations
+============
+
+Image.Image.get_child_images()
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. deprecated:: 11.2.0
+
+``Image.Image.get_child_images()`` has been deprecated. and will be removed in Pillow
+13 (2026-10-15). It will be moved to ``ImageFile.ImageFile.get_child_images()``. The
+method uses an image's file pointer, and so child images could only be retrieved from
+an :py:class:`PIL.ImageFile.ImageFile` instance.
+
+API Changes
+===========
+
+TODO
+^^^^
+
+TODO
+
+API Additions
+=============
+
+TODO
+^^^^
+
+TODO
+
+Other Changes
+=============
+
+TODO
+^^^^
+
+TODO
diff --git a/docs/releasenotes/index.rst b/docs/releasenotes/index.rst
index bd8e5536f..be9f623d0 100644
--- a/docs/releasenotes/index.rst
+++ b/docs/releasenotes/index.rst
@@ -14,6 +14,7 @@ expected to be backported to earlier versions.
.. toctree::
:maxdepth: 2
+ 11.2.0
11.1.0
11.0.0
10.4.0
diff --git a/src/PIL/Image.py b/src/PIL/Image.py
index 0648161be..e512e6fc7 100644
--- a/src/PIL/Image.py
+++ b/src/PIL/Image.py
@@ -1553,6 +1553,12 @@ class Image:
self._exif._loaded = False
self.getexif()
+ def get_child_images(self) -> list[ImageFile.ImageFile]:
+ from . import ImageFile
+
+ deprecate("Image.Image.get_child_images", 13)
+ return ImageFile.ImageFile.get_child_images(self) # type: ignore[arg-type]
+
def getim(self) -> CapsuleType:
"""
Returns a capsule that points to the internal image memory.
diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py
index 3476e48ff..93fb47874 100644
--- a/src/PIL/ImageFile.py
+++ b/src/PIL/ImageFile.py
@@ -180,8 +180,8 @@ class ImageFile(Image.Image):
ifds.append((ifd1, exif._info.next))
offset = None
- assert self.fp is not None
for ifd, ifd_offset in ifds:
+ assert self.fp is not None
current_offset = self.fp.tell()
if offset is None:
offset = current_offset
@@ -210,6 +210,7 @@ class ImageFile(Image.Image):
child_images.append(im)
if offset is not None:
+ assert self.fp is not None
self.fp.seek(offset)
return child_images
diff --git a/src/PIL/_deprecate.py b/src/PIL/_deprecate.py
index 83952b397..9f9d8bbc9 100644
--- a/src/PIL/_deprecate.py
+++ b/src/PIL/_deprecate.py
@@ -47,6 +47,8 @@ def deprecate(
raise RuntimeError(msg)
elif when == 12:
removed = "Pillow 12 (2025-10-15)"
+ elif when == 13:
+ removed = "Pillow 13 (2026-10-15)"
else:
msg = f"Unknown removal version: {when}. Update {__name__}?"
raise ValueError(msg)