Skip to content

Commit 3280527

Browse files
authored
Merge branch 'main' into hopper-lru-cache
2 parents d131f1c + a4e5dc2 commit 3280527

28 files changed

Lines changed: 733 additions & 139 deletions

.github/ISSUE_TEMPLATE/ISSUE_REPORT.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ Thank you.
4848
* Python:
4949
* Pillow:
5050

51+
```text
52+
Please paste here the output of running:
53+
54+
python3 -m PIL.report
55+
or
56+
python3 -m PIL --report
57+
58+
Or the output of the following Python code:
59+
60+
from PIL import report
61+
# or
62+
from PIL import features
63+
features.pilinfo(supported_formats=False)
64+
```
65+
5166
<!--
5267
Please include **code** that reproduces the issue and whenever possible, an **image** that demonstrates the issue. Please upload images to GitHub, not to third-party file hosting sites. If necessary, add the image to a zip or tar archive.
5368

.github/workflows/wheels-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ARCHIVE_SDIR=pillow-depends-main
1616

1717
# Package versions for fresh source builds
1818
FREETYPE_VERSION=2.13.2
19-
HARFBUZZ_VERSION=8.3.1
19+
HARFBUZZ_VERSION=8.4.0
2020
LIBPNG_VERSION=1.6.43
2121
JPEGTURBO_VERSION=3.0.2
2222
OPENJPEG_VERSION=2.5.2

.github/workflows/wheels.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
paths:
66
- ".ci/requirements-cibw.txt"
77
- ".github/workflows/wheel*"
8+
- "setup.py"
89
- "wheels/*"
910
- "winbuild/build_prepare.py"
1011
- "winbuild/fribidi.cmake"
@@ -14,6 +15,7 @@ on:
1415
paths:
1516
- ".ci/requirements-cibw.txt"
1617
- ".github/workflows/wheel*"
18+
- "setup.py"
1719
- "wheels/*"
1820
- "winbuild/build_prepare.py"
1921
- "winbuild/fribidi.cmake"

CHANGES.rst

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

8+
- Determine MPO size from markers, not EXIF data #7884
9+
[radarhere]
10+
11+
- Improved conversion from RGB to RGBa, LA and La #7888
12+
[radarhere]
13+
14+
- Support FITS images with GZIP_1 compression #7894
15+
[radarhere]
16+
817
- Use I;16 mode for 9-bit JPEG 2000 images #7900
918
[scaramallion, radarhere]
1019

Tests/helper.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,6 @@ def _cached_hopper(mode: str | None = None) -> Image.Image:
267267
return Image.open("Tests/images/hopper.ppm")
268268
if mode == "F":
269269
im = _cached_hopper("L").convert(mode)
270-
elif mode[:4] == "I;16":
271-
im = _cached_hopper("I").convert(mode)
272270
else:
273271
im = _cached_hopper().convert(mode)
274272
return im

Tests/images/m13.fits

180 KB
Binary file not shown.

Tests/images/m13_gzip.fits

Lines changed: 366 additions & 0 deletions
Large diffs are not rendered by default.
0 Bytes
Binary file not shown.

Tests/test_features.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ def test_unsupported_module() -> None:
117117
features.version_module(module)
118118

119119

120-
def test_pilinfo() -> None:
120+
@pytest.mark.parametrize("supported_formats", (True, False))
121+
def test_pilinfo(supported_formats) -> None:
121122
buf = io.StringIO()
122-
features.pilinfo(buf)
123+
features.pilinfo(buf, supported_formats=supported_formats)
123124
out = buf.getvalue()
124125
lines = out.splitlines()
125126
assert lines[0] == "-" * 68
@@ -129,9 +130,15 @@ def test_pilinfo() -> None:
129130
while lines[0].startswith(" "):
130131
lines = lines[1:]
131132
assert lines[0] == "-" * 68
132-
assert lines[1].startswith("Python modules loaded from ")
133-
assert lines[2].startswith("Binary modules loaded from ")
134-
assert lines[3] == "-" * 68
133+
assert lines[1].startswith("Python executable is")
134+
lines = lines[2:]
135+
if lines[0].startswith("Environment Python files loaded from"):
136+
lines = lines[1:]
137+
assert lines[0].startswith("System Python files loaded from")
138+
assert lines[1] == "-" * 68
139+
assert lines[2].startswith("Python Pillow modules loaded from ")
140+
assert lines[3].startswith("Binary Pillow modules loaded from ")
141+
assert lines[4] == "-" * 68
135142
jpeg = (
136143
"\n"
137144
+ "-" * 68
@@ -142,4 +149,4 @@ def test_pilinfo() -> None:
142149
+ "-" * 68
143150
+ "\n"
144151
)
145-
assert jpeg in out
152+
assert supported_formats == (jpeg in out)

Tests/test_file_fits.py

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

77
from PIL import FitsImagePlugin, Image
88

9-
from .helper import assert_image_equal, hopper
9+
from .helper import assert_image_equal, assert_image_equal_tofile, hopper
1010

1111
TEST_FILE = "Tests/images/hopper.fits"
1212

@@ -22,6 +22,11 @@ def test_open() -> None:
2222
assert_image_equal(im, hopper("L"))
2323

2424

25+
def test_gzip1() -> None:
26+
with Image.open("Tests/images/m13_gzip.fits") as im:
27+
assert_image_equal_tofile(im, "Tests/images/m13.fits")
28+
29+
2530
def test_invalid_file() -> None:
2631
# Arrange
2732
invalid_file = "Tests/images/flower.jpg"

0 commit comments

Comments
 (0)