Update Pillow to v10.0

This commit is contained in:
DevilXD authored and DevilXD committed 2023-10-14 17:49:38 +02:00
1 parent dcd740d18d
commit 67cfc6603d
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -84,7 +84,7 @@ class ImageCache:
return datetime.now(timezone.utc) + self.LIFETIME
def _hash(self, image: Image) -> ImageHash:
pixel_data = list(image.resize((10, 10), Image_module.ANTIALIAS).convert('L').getdata())
pixel_data = list(image.resize((10, 10), Image_module.LANCZOS).convert('L').getdata())
avg_pixel = sum(pixel_data) / len(pixel_data)
bits = ''.join('1' if px >= avg_pixel else '0' for px in pixel_data)
return ImageHash(f"{int(bits, 2):x}.png")