Skip to content

Commit 6a2b9b2

Browse files
authored
Merge branch 'main' into jxl-support2
2 parents 8e5aba9 + fc0f659 commit 6a2b9b2

25 files changed

Lines changed: 231 additions & 189 deletions

.github/workflows/test-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ jobs:
9898
choco install nasm --no-progress
9999
echo "C:\Program Files\NASM" >> $env:GITHUB_PATH
100100
101-
choco install ghostscript --version=10.6.0 --no-progress
102-
echo "C:\Program Files\gs\gs10.06.0\bin" >> $env:GITHUB_PATH
101+
choco install ghostscript --version=10.7.0 --no-progress
102+
echo "C:\Program Files\gs\gs10.07.0\bin" >> $env:GITHUB_PATH
103103
104104
# Install extra test images
105105
xcopy /S /Y Tests\test-images\* Tests\images

.github/workflows/wheels-dependencies.sh

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

9292
# Package versions for fresh source builds.
9393
FREETYPE_VERSION=2.14.2
94-
HARFBUZZ_VERSION=13.0.1
94+
HARFBUZZ_VERSION=13.2.1
9595
LIBPNG_VERSION=1.6.55
9696
JPEGTURBO_VERSION=3.1.3
9797
OPENJPEG_VERSION=2.5.4
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
STARTFONT
22
FONT �
33
SIZE 10
4-
FONTBOUNDINGBOX
5-
CHARS
4+
FONTBOUNDINGBOX 1 1 0 0
5+
CHARS 1
66
STARTCHAR
7-
ENCODING
7+
ENCODING 65
88
BBX 2 5
99
ENDCHAR
1010
ENDFONT

Tests/test_file_gif.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def test_roundtrip_save_all_1(tmp_path: Path) -> None:
314314
def test_save_zero(size: tuple[int, int]) -> None:
315315
b = BytesIO()
316316
im = Image.new("RGB", size)
317-
with pytest.raises(SystemError):
317+
with pytest.raises(ValueError, match="cannot write empty image"):
318318
im.save(b, "GIF")
319319

320320

Tests/test_file_jpeg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def test_sanity(self) -> None:
8585
def test_zero(self, size: tuple[int, int], tmp_path: Path) -> None:
8686
f = tmp_path / "temp.jpg"
8787
im = Image.new("RGB", size)
88-
with pytest.raises(ValueError):
88+
with pytest.raises(ValueError, match="cannot write empty image"):
8989
im.save(f)
9090

9191
def test_app(self) -> None:

Tests/test_file_jpeg2k.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ def test_pclr() -> None:
445445
) as im:
446446
assert im.mode == "P"
447447
assert im.palette is not None
448+
assert im.palette.mode == "CMYK"
448449
assert len(im.palette.colors) == 139
449450
assert im.palette.colors[(0, 0, 0, 0)] == 0
450451

Tests/test_file_libtiff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ def test_save_single_strip(
12441244
def test_save_zero(self, compression: str | None, tmp_path: Path) -> None:
12451245
im = Image.new("RGB", (0, 0))
12461246
out = tmp_path / "temp.tif"
1247-
with pytest.raises(SystemError):
1247+
with pytest.raises(ValueError, match="cannot write empty image"):
12481248
im.save(out, compression=compression)
12491249

12501250
def test_save_many_compressed(self, tmp_path: Path) -> None:

Tests/test_file_png.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,16 @@ def test_plte_length(self, tmp_path: Path) -> None:
707707
assert reloaded.png.im_palette is not None
708708
assert len(reloaded.png.im_palette[1]) == 3
709709

710+
def test_plte_cmyk(self, tmp_path: Path) -> None:
711+
im = Image.new("P", (1, 1))
712+
im.putpalette((0, 100, 150, 200), "CMYK")
713+
714+
out = tmp_path / "temp.png"
715+
im.save(out)
716+
717+
with Image.open(out) as reloaded:
718+
assert reloaded.convert("CMYK").getpixel((0, 0)) == (200, 222, 232, 0)
719+
710720
def test_getxmp(self) -> None:
711721
with Image.open("Tests/images/color_snakes.png") as im:
712722
if ElementTree is None:

Tests/test_file_spider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def test_save(tmp_path: Path) -> None:
7272
def test_save_zero(size: tuple[int, int]) -> None:
7373
b = BytesIO()
7474
im = Image.new("1", size)
75-
with pytest.raises(SystemError):
75+
with pytest.raises(ValueError, match="cannot write empty image"):
7676
im.save(b, "SPIDER")
7777

7878

Tests/test_file_tga.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
_TGA_DIR_COMMON = os.path.join(_TGA_DIR, "common")
1414

1515

16-
_ORIGINS = ("tl", "bl")
17-
1816
_ORIGIN_TO_ORIENTATION = {"tl": 1, "bl": -1}
1917

2018

@@ -29,7 +27,7 @@
2927
("200x32", "RGBA"),
3028
),
3129
)
32-
@pytest.mark.parametrize("origin", _ORIGINS)
30+
@pytest.mark.parametrize("origin", _ORIGIN_TO_ORIENTATION)
3331
@pytest.mark.parametrize("rle", (True, False))
3432
def test_sanity(
3533
size_mode: tuple[str, str], origin: str, rle: str, tmp_path: Path

0 commit comments

Comments
 (0)