Skip to content

Commit

Permalink
fixed tests with Pillow 10
Browse files Browse the repository at this point in the history
Signed-off-by: bigcat88 <[email protected]>
  • Loading branch information
bigcat88 committed Apr 12, 2023
1 parent b40fae4 commit 763aeda
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def compare_hashes(pillow_images: list, hash_size=16, max_difference=0):
if isinstance(pillow_image, (str, Path, BytesIO)):
pillow_image = Image.open(pillow_image)
pillow_image = ImageOps.exif_transpose(pillow_image)
pillow_image = pillow_image.convert("L").resize((hash_size + 1, hash_size), Image.ANTIALIAS)
# Image.Resampling.LANCZOS = 1
pillow_image = pillow_image.convert("L").resize((hash_size + 1, hash_size), 1)
pixels = np.asarray(pillow_image) # noqa
diff = pixels[:, 1:] > pixels[:, :-1]
image_hash = diff.flatten() # noqa
Expand Down

0 comments on commit 763aeda

Please sign in to comment.