From 269a878c63dbafe2d2d8ed7953966fded28a09a3 Mon Sep 17 00:00:00 2001 From: NeoMod Date: Sun, 6 Aug 2023 09:25:28 +0200 Subject: [PATCH] Update image_processing.py Fix for ANTIALIAS function beeing removed in Pillow 10.0.0 (after being deprecated through many previous versions). The same function is now called trough PIL.Image.LANCZOS or PIL.Image.Resampling.LANCZOS. --- custom_components/codeproject_ai_object/image_processing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/codeproject_ai_object/image_processing.py b/custom_components/codeproject_ai_object/image_processing.py index e5c4169..e8ed1e2 100644 --- a/custom_components/codeproject_ai_object/image_processing.py +++ b/custom_components/codeproject_ai_object/image_processing.py @@ -344,7 +344,7 @@ def process_image(self, image): # resize image if different then default if self._scale != DEAULT_SCALE: newsize = (self._image_width * self._scale, self._image_width * self._scale) - self._image.thumbnail(newsize, Image.ANTIALIAS) + self._image.thumbnail(newsize, Image.LANCZOS) self._image_width, self._image_height = self._image.size with io.BytesIO() as output: self._image.save(output, format="JPEG")