Skip to content

Commit db76eaa

Browse files
authored
Merge branch 'main' into comment_correct_placement
2 parents 6257e78 + 30a0e44 commit db76eaa

38 files changed

+290
-204
lines changed

.github/workflows/test-docker.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
matrix:
1212
docker: [
1313
# Run slower jobs first to give them a headstart and reduce waiting time
14-
ubuntu-20.04-focal-arm64v8,
15-
ubuntu-20.04-focal-ppc64le,
16-
ubuntu-20.04-focal-s390x,
14+
ubuntu-22.04-jammy-arm64v8,
15+
ubuntu-22.04-jammy-ppc64le,
16+
ubuntu-22.04-jammy-s390x,
1717
# Then run the remainder
1818
alpine,
1919
amazon-2-amd64,
@@ -32,11 +32,11 @@ jobs:
3232
]
3333
dockerTag: [main]
3434
include:
35-
- docker: "ubuntu-20.04-focal-arm64v8"
35+
- docker: "ubuntu-22.04-jammy-arm64v8"
3636
qemu-arch: "aarch64"
37-
- docker: "ubuntu-20.04-focal-ppc64le"
37+
- docker: "ubuntu-22.04-jammy-ppc64le"
3838
qemu-arch: "ppc64le"
39-
- docker: "ubuntu-20.04-focal-s390x"
39+
- docker: "ubuntu-22.04-jammy-s390x"
4040
qemu-arch: "s390x"
4141

4242
name: ${{ matrix.docker }}

CHANGES.rst

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

8+
- Separate multiple GIF comment blocks with newlines #6294
9+
[raygard, radarhere]
10+
11+
- Always use GIF89a for comments #6292
12+
[raygard, radarhere]
13+
14+
- Ignore compression value from BMP info dictionary when saving as TIFF #6231
15+
[radarhere]
16+
17+
- If font is file-like object, do not re-read from object to get variant #6234
18+
[radarhere]
19+
20+
- Raise ValueError when trying to access internal fp after close #6213
21+
[radarhere]
22+
23+
- Support more affine expression forms in im.point() #6254
24+
[benrg, radarhere]
25+
826
- Populate Python palette in fromarray() #6283
927
[radarhere]
1028

@@ -17,9 +35,6 @@ Changelog (Pillow)
1735
- Adjust BITSPERSAMPLE to match SAMPLESPERPIXEL when opening TIFFs #6270
1836
[radarhere]
1937

20-
- Do not open images with zero or negative height #6269
21-
[radarhere]
22-
2338
- Search pkgconf system libs/cflags #6138
2439
[jameshilliard, radarhere]
2540

@@ -50,6 +65,15 @@ Changelog (Pillow)
5065
- Deprecated PhotoImage.paste() box parameter #6178
5166
[radarhere]
5267

68+
9.1.1 (2022-05-17)
69+
------------------
70+
71+
- When reading past the end of a TGA scan line, reduce bytes left. CVE-2022-30595
72+
[radarhere]
73+
74+
- Do not open images with zero or negative height #6269
75+
[radarhere]
76+
5377
9.1.0 (2022-04-01)
5478
------------------
5579

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ release-test:
8585
sdist:
8686
python3 -m build --help > /dev/null 2>&1 || python3 -m pip install build
8787
python3 -m build --sdist
88+
python3 -m twine --help > /dev/null 2>&1 || python3 -m pip install twine
89+
python3 -m twine check --strict dist/*
8890

8991
.PHONY: test
9092
test:

RELEASING.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Released quarterly on January 2nd, April 1st, July 1st and October 15th.
2424
* [ ] Create and check source distribution:
2525
```bash
2626
make sdist
27-
python3 -m twine check --strict dist/*
2827
```
2928
* [ ] Create [binary distributions](https://github.com/python-pillow/Pillow/blob/main/RELEASING.md#binary-distributions)
3029
* [ ] Check and upload all binaries and source distributions e.g.:
@@ -61,7 +60,6 @@ Released as needed for security, installation or critical bug fixes.
6160
* [ ] Create and check source distribution:
6261
```bash
6362
make sdist
64-
python3 -m twine check --strict dist/*
6563
```
6664
* [ ] Create [binary distributions](https://github.com/python-pillow/Pillow/blob/main/RELEASING.md#binary-distributions)
6765
* [ ] Check and upload all binaries and source distributions e.g.:
@@ -91,7 +89,6 @@ Released as needed privately to individual vendors for critical security-related
9189
* [ ] Create and check source distribution:
9290
```bash
9391
make sdist
94-
python3 -m twine check --strict dist/*
9592
```
9693
* [ ] Create [binary distributions](https://github.com/python-pillow/Pillow/blob/main/RELEASING.md#binary-distributions)
9794
* [ ] Publish the [release on GitHub](https://github.com/python-pillow/Pillow/releases)
4.77 KB
Binary file not shown.

Tests/images/multiple_comments.gif

1.5 KB
Loading

Tests/test_file_apng.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,15 @@ def test_apng_save_blend(tmp_path):
637637
assert im.getpixel((0, 0)) == (0, 255, 0, 255)
638638

639639

640+
def test_seek_after_close():
641+
im = Image.open("Tests/images/apng/delay.png")
642+
im.seek(1)
643+
im.close()
644+
645+
with pytest.raises(ValueError):
646+
im.seek(0)
647+
648+
640649
def test_constants_deprecation():
641650
for enum, prefix in {
642651
PngImagePlugin.Disposal: "APNG_DISPOSE_",

Tests/test_file_fli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ def test_closed_file():
4646
im.close()
4747

4848

49+
def test_seek_after_close():
50+
im = Image.open(animated_test_file)
51+
im.seek(1)
52+
im.close()
53+
54+
with pytest.raises(ValueError):
55+
im.seek(0)
56+
57+
4958
def test_context_manager():
5059
with warnings.catch_warnings():
5160
with Image.open(static_test_file) as im:

Tests/test_file_gif.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ def test_closed_file():
4646
im.close()
4747

4848

49+
def test_seek_after_close():
50+
im = Image.open("Tests/images/iss634.gif")
51+
im.load()
52+
im.close()
53+
54+
with pytest.raises(ValueError):
55+
im.is_animated
56+
with pytest.raises(ValueError):
57+
im.n_frames
58+
with pytest.raises(ValueError):
59+
im.seek(1)
60+
61+
4962
def test_context_manager():
5063
with warnings.catch_warnings():
5164
with Image.open(TEST_GIF) as im:
@@ -794,6 +807,9 @@ def test_comment(tmp_path):
794807
with Image.open(out) as reread:
795808
assert reread.info["comment"] == im.info["comment"].encode()
796809

810+
# Test that GIF89a is used for comments
811+
assert reread.info["version"] == b"GIF89a"
812+
797813

798814
def test_comment_over_255(tmp_path):
799815
out = str(tmp_path / "temp.gif")
@@ -804,15 +820,23 @@ def test_comment_over_255(tmp_path):
804820
im.info["comment"] = comment
805821
im.save(out)
806822
with Image.open(out) as reread:
807-
808823
assert reread.info["comment"] == comment
809824

825+
# Test that GIF89a is used for comments
826+
assert reread.info["version"] == b"GIF89a"
827+
810828

811829
def test_zero_comment_subblocks():
812830
with Image.open("Tests/images/hopper_zero_comment_subblocks.gif") as im:
813831
assert_image_equal_tofile(im, TEST_GIF)
814832

815833

834+
def test_read_multiple_comment_blocks():
835+
with Image.open("Tests/images/multiple_comments.gif") as im:
836+
# Multiple comment blocks in a frame are separated not concatenated
837+
assert im.info["comment"] == b"Test comment 1\nTest comment 2"
838+
839+
816840
def test_write_comment(tmp_path):
817841
out = str(tmp_path / "temp.gif")
818842
with Image.open("Tests/images/dispose_prev.gif") as im:

Tests/test_file_libtiff.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
hopper,
1919
mark_if_feature_version,
2020
skip_unless_feature,
21+
skip_unless_feature_version,
2122
)
2223

2324

@@ -991,6 +992,7 @@ def test_sampleformat_not_corrupted(self):
991992
with Image.open(out) as im:
992993
im.load()
993994

995+
@skip_unless_feature_version("libtiff", "4.0.4")
994996
def test_realloc_overflow(self):
995997
TiffImagePlugin.READ_LIBTIFF = True
996998
with Image.open("Tests/images/tiff_overflow_rows_per_strip.tif") as im:

0 commit comments

Comments
 (0)