mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-30 01:49:49 +03:00
Merge branch 'main' into patched-zlib-ng
This commit is contained in:
commit
daa38a76ac
2
.github/workflows/wheels-dependencies.sh
vendored
2
.github/workflows/wheels-dependencies.sh
vendored
|
@ -48,7 +48,7 @@ OPENJPEG_VERSION=2.5.3
|
||||||
XZ_VERSION=5.6.4
|
XZ_VERSION=5.6.4
|
||||||
TIFF_VERSION=4.6.0
|
TIFF_VERSION=4.6.0
|
||||||
LCMS2_VERSION=2.16
|
LCMS2_VERSION=2.16
|
||||||
ZLIB_NG_VERSION=2.2.3 # patched
|
ZLIB_NG_VERSION=2.2.4 # patched
|
||||||
LIBWEBP_VERSION=1.5.0
|
LIBWEBP_VERSION=1.5.0
|
||||||
BZIP2_VERSION=1.0.8
|
BZIP2_VERSION=1.0.8
|
||||||
LIBXCB_VERSION=1.17.0
|
LIBXCB_VERSION=1.17.0
|
||||||
|
|
|
@ -1345,7 +1345,7 @@ def test_save_I(tmp_path: Path) -> None:
|
||||||
assert_image_equal(reloaded.convert("L"), im.convert("L"))
|
assert_image_equal(reloaded.convert("L"), im.convert("L"))
|
||||||
|
|
||||||
|
|
||||||
def test_getdata() -> None:
|
def test_getdata(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||||
# Test getheader/getdata against legacy values.
|
# Test getheader/getdata against legacy values.
|
||||||
# Create a 'P' image with holes in the palette.
|
# Create a 'P' image with holes in the palette.
|
||||||
im = Image._wedge().resize((16, 16), Image.Resampling.NEAREST)
|
im = Image._wedge().resize((16, 16), Image.Resampling.NEAREST)
|
||||||
|
@ -1354,23 +1354,21 @@ def test_getdata() -> None:
|
||||||
|
|
||||||
passed_palette = bytes(255 - i // 3 for i in range(768))
|
passed_palette = bytes(255 - i // 3 for i in range(768))
|
||||||
|
|
||||||
GifImagePlugin._FORCE_OPTIMIZE = True
|
monkeypatch.setattr(GifImagePlugin, "_FORCE_OPTIMIZE", True)
|
||||||
try:
|
|
||||||
h = GifImagePlugin.getheader(im, passed_palette)
|
|
||||||
d = GifImagePlugin.getdata(im)
|
|
||||||
|
|
||||||
import pickle
|
h = GifImagePlugin.getheader(im, passed_palette)
|
||||||
|
d = GifImagePlugin.getdata(im)
|
||||||
|
|
||||||
# Enable to get target values on pre-refactor version
|
import pickle
|
||||||
# with open('Tests/images/gif_header_data.pkl', 'wb') as f:
|
|
||||||
# pickle.dump((h, d), f, 1)
|
|
||||||
with open("Tests/images/gif_header_data.pkl", "rb") as f:
|
|
||||||
(h_target, d_target) = pickle.load(f)
|
|
||||||
|
|
||||||
assert h == h_target
|
# Enable to get target values on pre-refactor version
|
||||||
assert d == d_target
|
# with open('Tests/images/gif_header_data.pkl', 'wb') as f:
|
||||||
finally:
|
# pickle.dump((h, d), f, 1)
|
||||||
GifImagePlugin._FORCE_OPTIMIZE = False
|
with open("Tests/images/gif_header_data.pkl", "rb") as f:
|
||||||
|
(h_target, d_target) = pickle.load(f)
|
||||||
|
|
||||||
|
assert h == h_target
|
||||||
|
assert d == d_target
|
||||||
|
|
||||||
|
|
||||||
def test_lzw_bits() -> None:
|
def test_lzw_bits() -> None:
|
||||||
|
|
|
@ -116,12 +116,13 @@ V = {
|
||||||
"HARFBUZZ": "10.2.0",
|
"HARFBUZZ": "10.2.0",
|
||||||
"JPEGTURBO": "3.1.0",
|
"JPEGTURBO": "3.1.0",
|
||||||
"LCMS2": "2.16",
|
"LCMS2": "2.16",
|
||||||
|
"LIBIMAGEQUANT": "4.3.4",
|
||||||
"LIBPNG": "1.6.46",
|
"LIBPNG": "1.6.46",
|
||||||
"LIBWEBP": "1.5.0",
|
"LIBWEBP": "1.5.0",
|
||||||
"OPENJPEG": "2.5.3",
|
"OPENJPEG": "2.5.3",
|
||||||
"TIFF": "4.6.0",
|
"TIFF": "4.6.0",
|
||||||
"XZ": "5.6.4",
|
"XZ": "5.6.4",
|
||||||
"ZLIBNG": "2.2.3",
|
"ZLIBNG": "2.2.4",
|
||||||
}
|
}
|
||||||
V["LIBPNG_XY"] = "".join(V["LIBPNG"].split(".")[:2])
|
V["LIBPNG_XY"] = "".join(V["LIBPNG"].split(".")[:2])
|
||||||
|
|
||||||
|
@ -335,24 +336,15 @@ DEPS: dict[str, dict[str, Any]] = {
|
||||||
"libs": [r"bin\*.lib"],
|
"libs": [r"bin\*.lib"],
|
||||||
},
|
},
|
||||||
"libimagequant": {
|
"libimagequant": {
|
||||||
# commit: Merge branch 'master' into msvc (matches 2.17.0 tag)
|
"url": "https://github.com/ImageOptim/libimagequant/archive/{V['LIBIMAGEQUANT']}.tar.gz",
|
||||||
"url": "https://github.com/ImageOptim/libimagequant/archive/e4c1334be0eff290af5e2b4155057c2953a313ab.zip",
|
"filename": f"libimagequant-{V['LIBIMAGEQUANT']}.tar.gz",
|
||||||
"filename": "libimagequant-e4c1334be0eff290af5e2b4155057c2953a313ab.zip",
|
|
||||||
"license": "COPYRIGHT",
|
"license": "COPYRIGHT",
|
||||||
"patch": {
|
|
||||||
"CMakeLists.txt": {
|
|
||||||
"if(OPENMP_FOUND)": "if(false)",
|
|
||||||
"install": "#install",
|
|
||||||
# libimagequant does not detect MSVC x86_arm64 cross-compiler correctly
|
|
||||||
"if(${{CMAKE_SYSTEM_PROCESSOR}} STREQUAL ARM64)": "if({architecture} STREQUAL ARM64)", # noqa: E501
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"build": [
|
"build": [
|
||||||
*cmds_cmake("imagequant_a"),
|
cmd_cd("imagequant-sys"),
|
||||||
cmd_copy("imagequant_a.lib", "imagequant.lib"),
|
"cargo build --release",
|
||||||
],
|
],
|
||||||
"headers": [r"*.h"],
|
"headers": ["libimagequant.h"],
|
||||||
"libs": [r"imagequant.lib"],
|
"libs": [r"..\target\release\imagequant_sys.lib"],
|
||||||
},
|
},
|
||||||
"harfbuzz": {
|
"harfbuzz": {
|
||||||
"url": f"https://github.com/harfbuzz/harfbuzz/archive/{V['HARFBUZZ']}.zip",
|
"url": f"https://github.com/harfbuzz/harfbuzz/archive/{V['HARFBUZZ']}.zip",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user