Skip to content

Commit aeb51cb

Browse files
authored
Merge branch 'main' into lcms
2 parents facf3af + 5beb0b6 commit aeb51cb

15 files changed

+962
-291
lines changed

CHANGES.rst

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Changelog (Pillow)
55
10.3.0 (unreleased)
66
-------------------
77

8+
- Deprecate eval(), replacing it with lambda_eval() and unsafe_eval() #7927
9+
[radarhere, hugovk]
10+
11+
- Raise ValueError if seeking to greater than offset-sized integer in TIFF #7883
12+
[radarhere]
13+
814
- Add --report argument to __main__.py to omit supported formats #7818
915
[nulano, radarhere, hugovk]
1016

Tests/helper.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ def assert_image_similar(
115115

116116
diff = 0
117117
for ach, bch in zip(a.split(), b.split()):
118-
chdiff = ImageMath.eval("abs(a - b)", a=ach, b=bch).convert("L")
118+
chdiff = ImageMath.lambda_eval(
119+
lambda args: abs(args["a"] - args["b"]), a=ach, b=bch
120+
).convert("L")
119121
diff += sum(i * num for i, num in enumerate(chdiff.histogram()))
120122

121123
ave_diff = diff / (a.size[0] * a.size[1])

Tests/test_image_reduce.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ def assert_compare_images(
186186

187187
bands = ImageMode.getmode(a.mode).bands
188188
for band, ach, bch in zip(bands, a.split(), b.split()):
189-
ch_diff = ImageMath.eval("convert(abs(a - b), 'L')", a=ach, b=bch)
189+
ch_diff = ImageMath.lambda_eval(
190+
lambda args: args["convert"](abs(args["a"] - args["b"]), "L"), a=ach, b=bch
191+
)
190192
ch_hist = ch_diff.histogram()
191193

192194
average_diff = sum(i * num for i, num in enumerate(ch_hist)) / (

Tests/test_imagemath.py

-214
This file was deleted.

0 commit comments

Comments
 (0)