Skip to content

Commit

Permalink
Merge branch 'main' into lcms
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere authored Apr 1, 2024
2 parents facf3af + 5beb0b6 commit aeb51cb
Show file tree
Hide file tree
Showing 15 changed files with 962 additions and 291 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Changelog (Pillow)
10.3.0 (unreleased)
-------------------

- Deprecate eval(), replacing it with lambda_eval() and unsafe_eval() #7927
[radarhere, hugovk]

- Raise ValueError if seeking to greater than offset-sized integer in TIFF #7883
[radarhere]

- Add --report argument to __main__.py to omit supported formats #7818
[nulano, radarhere, hugovk]

Expand Down
4 changes: 3 additions & 1 deletion Tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ def assert_image_similar(

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

ave_diff = diff / (a.size[0] * a.size[1])
Expand Down
4 changes: 3 additions & 1 deletion Tests/test_image_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ def assert_compare_images(

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

average_diff = sum(i * num for i, num in enumerate(ch_hist)) / (
Expand Down
214 changes: 0 additions & 214 deletions Tests/test_imagemath.py

This file was deleted.

Loading

0 comments on commit aeb51cb

Please sign in to comment.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy