diff --git a/.ci/install.sh b/.ci/install.sh index e61752750..62677005e 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -20,7 +20,7 @@ fi set -e if [[ $(uname) != CYGWIN* ]]; then - sudo apt-get -qq install libfreetype6-dev liblcms2-dev python3-tk\ + sudo apt-get -qq install libfreetype6-dev liblcms2-dev libtiff-dev python3-tk\ ghostscript libjpeg-turbo8-dev libopenjp2-7-dev\ cmake meson imagemagick libharfbuzz-dev libfribidi-dev\ sway wl-clipboard libopenblas-dev diff --git a/.ci/requirements-cibw.txt b/.ci/requirements-cibw.txt index 2fd3eb6ff..f2109ed61 100644 --- a/.ci/requirements-cibw.txt +++ b/.ci/requirements-cibw.txt @@ -1 +1 @@ -cibuildwheel==2.23.0 +cibuildwheel==2.23.1 diff --git a/.github/workflows/test-docker.yml b/.github/workflows/test-docker.yml index da5e191da..25aef55fb 100644 --- a/.github/workflows/test-docker.yml +++ b/.github/workflows/test-docker.yml @@ -35,6 +35,10 @@ jobs: matrix: os: ["ubuntu-latest"] docker: [ + # Run slower jobs first to give them a headstart and reduce waiting time + ubuntu-24.04-noble-ppc64le, + ubuntu-24.04-noble-s390x, + # Then run the remainder alpine, amazon-2-amd64, amazon-2023-amd64, @@ -52,13 +56,9 @@ jobs: dockerTag: [main] include: - docker: "ubuntu-24.04-noble-ppc64le" - os: "ubuntu-22.04" qemu-arch: "ppc64le" - dockerTag: main - docker: "ubuntu-24.04-noble-s390x" - os: "ubuntu-22.04" qemu-arch: "s390x" - dockerTag: main - docker: "ubuntu-24.04-noble-arm64v8" os: "ubuntu-24.04-arm" dockerTag: main @@ -75,8 +75,9 @@ jobs: - name: Set up QEMU if: "matrix.qemu-arch" - run: | - docker run --rm --privileged aptman/qus -s -- -p ${{ matrix.qemu-arch }} + uses: docker/setup-qemu-action@v3 + with: + platforms: ${{ matrix.qemu-arch }} - name: Docker pull run: | diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index ef49ff332..a780c7835 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -94,8 +94,8 @@ jobs: choco install nasm --no-progress echo "C:\Program Files\NASM" >> $env:GITHUB_PATH - choco install ghostscript --version=10.4.0 --no-progress - echo "C:\Program Files\gs\gs10.04.0\bin" >> $env:GITHUB_PATH + choco install ghostscript --version=10.5.0 --no-progress + echo "C:\Program Files\gs\gs10.05.0\bin" >> $env:GITHUB_PATH # Install extra test images xcopy /S /Y Tests\test-images\* Tests\images diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh index 202a8935d..e9c54536e 100755 --- a/.github/workflows/wheels-dependencies.sh +++ b/.github/workflows/wheels-dependencies.sh @@ -43,7 +43,7 @@ LIBPNG_VERSION=1.6.47 JPEGTURBO_VERSION=3.1.0 OPENJPEG_VERSION=2.5.3 XZ_VERSION=5.6.4 -TIFF_VERSION=4.6.0 +TIFF_VERSION=4.7.0 LCMS2_VERSION=2.17 ZLIB_NG_VERSION=2.2.4 LIBWEBP_VERSION=1.5.0 diff --git a/Tests/test_file_fli.py b/Tests/test_file_fli.py index 8a95af62d..2f39adc69 100644 --- a/Tests/test_file_fli.py +++ b/Tests/test_file_fli.py @@ -1,5 +1,6 @@ from __future__ import annotations +import io import warnings import pytest @@ -132,6 +133,15 @@ def test_eoferror() -> None: im.seek(n_frames - 1) +def test_missing_frame_size() -> None: + with open(animated_test_file, "rb") as fp: + data = fp.read() + data = data[:6188] + with Image.open(io.BytesIO(data)) as im: + with pytest.raises(EOFError, match="missing frame size"): + im.seek(1) + + def test_seek_tell() -> None: with Image.open(animated_test_file) as im: layer_number = im.tell() diff --git a/Tests/test_file_jpeg2k.py b/Tests/test_file_jpeg2k.py index 01172fdbb..e429610ad 100644 --- a/Tests/test_file_jpeg2k.py +++ b/Tests/test_file_jpeg2k.py @@ -317,12 +317,12 @@ def test_grayscale_four_channels() -> None: with open("Tests/images/rgb_trns_ycbc.jp2", "rb") as fp: data = fp.read() - # Change color space to OPJ_CLRSPC_GRAY - data = data[:76] + b"\x11" + data[77:] + # Change color space to OPJ_CLRSPC_GRAY + data = data[:76] + b"\x11" + data[77:] - with Image.open(BytesIO(data)) as im: - im.load() - assert im.mode == "RGBA" + with Image.open(BytesIO(data)) as im: + im.load() + assert im.mode == "RGBA" @pytest.mark.skipif( diff --git a/Tests/test_file_pcx.py b/Tests/test_file_pcx.py index aa24189f4..21c32268c 100644 --- a/Tests/test_file_pcx.py +++ b/Tests/test_file_pcx.py @@ -40,7 +40,7 @@ def test_sanity(tmp_path: Path) -> None: def test_bad_image_size() -> None: with open("Tests/images/pil184.pcx", "rb") as fp: data = fp.read() - data = data[:4] + b"\xff\xff" + data[6:] + data = data[:4] + b"\xff\xff" + data[6:] b = io.BytesIO(data) with pytest.raises(SyntaxError, match="bad PCX image size"): @@ -51,7 +51,7 @@ def test_bad_image_size() -> None: def test_unknown_mode() -> None: with open("Tests/images/pil184.pcx", "rb") as fp: data = fp.read() - data = data[:3] + b"\xff" + data[4:] + data = data[:3] + b"\xff" + data[4:] b = io.BytesIO(data) with pytest.raises(OSError, match="unknown PCX mode"): diff --git a/Tests/test_font_bdf.py b/Tests/test_font_bdf.py index 2ece5457a..b4155c879 100644 --- a/Tests/test_font_bdf.py +++ b/Tests/test_font_bdf.py @@ -20,8 +20,8 @@ def test_sanity() -> None: def test_zero_width_chars() -> None: with open(filename, "rb") as fp: data = fp.read() - data = data[:2650] + b"\x00\x00" + data[2652:] - BdfFontFile.BdfFontFile(io.BytesIO(data)) + data = data[:2650] + b"\x00\x00" + data[2652:] + BdfFontFile.BdfFontFile(io.BytesIO(data)) def test_invalid_file() -> None: diff --git a/docs/installation/building-from-source.rst b/docs/installation/building-from-source.rst index b400a3436..2790bc2e6 100644 --- a/docs/installation/building-from-source.rst +++ b/docs/installation/building-from-source.rst @@ -44,7 +44,7 @@ Many of Pillow's features require external libraries: * **libtiff** provides compressed TIFF functionality - * Pillow has been tested with libtiff versions **3.x** and **4.0-4.6.0** + * Pillow has been tested with libtiff versions **3.x** and **4.0-4.7.0** * **libfreetype** provides type related services diff --git a/winbuild/build_prepare.py b/winbuild/build_prepare.py index a645722d8..ea3d99394 100644 --- a/winbuild/build_prepare.py +++ b/winbuild/build_prepare.py @@ -120,7 +120,7 @@ V = { "LIBPNG": "1.6.47", "LIBWEBP": "1.5.0", "OPENJPEG": "2.5.3", - "TIFF": "4.6.0", + "TIFF": "4.7.0", "XZ": "5.6.4", "ZLIBNG": "2.2.4", }