Skip to content

Commit 69de03b

Browse files
authored
Merge branch 'python-pillow:main' into parametrize
2 parents 797eb39 + b6348d9 commit 69de03b

28 files changed

+161
-85
lines changed

.ci/install.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ python3 -m pip install -U pytest-timeout
3737
python3 -m pip install pyroma
3838

3939
if [[ $(uname) != CYGWIN* ]]; then
40-
# TODO Remove condition when NumPy supports 3.11
41-
if ! [ "$GHA_PYTHON_VERSION" == "3.11-dev" ]; then python3 -m pip install numpy ; fi
40+
python3 -m pip install numpy
4241

4342
# PyQt6 doesn't support PyPy3
4443
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then

.github/workflows/cifuzz.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- "**.h"
1212
workflow_dispatch:
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
Fuzzing:
1619
runs-on: ubuntu-latest

.github/workflows/macos-install.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ python3 -m pip install -U pytest-timeout
1414
python3 -m pip install pyroma
1515

1616
echo -e "[openblas]\nlibraries = openblas\nlibrary_dirs = /usr/local/opt/openblas/lib" >> ~/.numpy-site.cfg
17-
# TODO Remove condition when NumPy supports 3.11
18-
if ! [ "$GHA_PYTHON_VERSION" == "3.11-dev" ]; then python3 -m pip install numpy ; fi
17+
python3 -m pip install numpy
1918

2019
# extra test images
2120
pushd depends && ./install_extra_test_images.sh && popd

.github/workflows/test-cygwin.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Test Cygwin
22

33
on: [push, pull_request, workflow_dispatch]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
build:
710
runs-on: windows-latest

CHANGES.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,30 @@ Changelog (Pillow)
55
9.3.0 (unreleased)
66
------------------
77

8+
- Copy palette when converting from P to PA #6497
9+
[radarhere]
10+
11+
- Allow RGB and RGBA values for PA image putpixel #6504
12+
[radarhere]
13+
14+
- Removed support for tkinter in PyPy before Python 3.6 #6551
15+
[nulano]
16+
17+
- Do not use CCITTFaxDecode filter if libtiff is not available #6518
18+
[radarhere]
19+
20+
- Fallback to not using mmap if buffer is not large enough #6510
21+
[radarhere]
22+
23+
- Fixed writing bytes as ASCII tag #6493
24+
[radarhere]
25+
26+
- Open 1 bit EPS in mode 1 #6499
27+
[radarhere]
28+
29+
- Removed support for tkinter before Python 1.5.2 #6549
30+
[radarhere]
31+
832
- Allow default ImageDraw font to be set #6484
933
[radarhere, hugovk]
1034

Tests/images/1.eps

44.8 KB
Binary file not shown.

Tests/images/mmap_error.bmp

9.04 KB
Binary file not shown.

Tests/test_file_bmp.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ def test_invalid_file():
3939
BmpImagePlugin.BmpImageFile(fp)
4040

4141

42+
def test_fallback_if_mmap_errors():
43+
# This image has been truncated,
44+
# so that the buffer is not large enough when using mmap
45+
with Image.open("Tests/images/mmap_error.bmp") as im:
46+
assert_image_equal_tofile(im, "Tests/images/pal8_offset.bmp")
47+
48+
4249
def test_save_to_bytes():
4350
output = io.BytesIO()
4451
im = hopper()

Tests/test_file_eps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ def test_bytesio_object():
146146
assert_image_similar(img, image1_scale1_compare, 5)
147147

148148

149+
def test_1_mode():
150+
with Image.open("Tests/images/1.eps") as im:
151+
assert im.mode == "1"
152+
153+
149154
def test_image_mode_not_supported(tmp_path):
150155
im = hopper("RGBA")
151156
tmpfile = str(tmp_path / "temp.eps")

Tests/test_file_pdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import pytest
88

9-
from PIL import Image, PdfParser
9+
from PIL import Image, PdfParser, features
1010

1111
from .helper import hopper, mark_if_feature_version
1212

@@ -44,7 +44,7 @@ def test_monochrome(tmp_path):
4444

4545
# Act / Assert
4646
outfile = helper_save_as_pdf(tmp_path, mode)
47-
assert os.path.getsize(outfile) < 5000
47+
assert os.path.getsize(outfile) < (5000 if features.check("libtiff") else 15000)
4848

4949

5050
def test_greyscale(tmp_path):

0 commit comments

Comments
 (0)