From 0603368370cd3c0852f39a67b5667228016ca18b Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Wed, 5 Jul 2023 11:05:37 -0700 Subject: [PATCH] Update examples to work with Pillow 10.0.0 --- examples/rgb_display_pillow_animated_gif.py | 2 +- examples/rgb_display_pillow_image.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/rgb_display_pillow_animated_gif.py b/examples/rgb_display_pillow_animated_gif.py index a268a2b..cc3a628 100644 --- a/examples/rgb_display_pillow_animated_gif.py +++ b/examples/rgb_display_pillow_animated_gif.py @@ -124,7 +124,7 @@ def preload(self): frame_object.image = ImageOps.pad( # pylint: disable=no-member image.convert("RGB"), (self._width, self._height), - method=Image.Resampling.NEAREST, + method=Image.NEAREST, color=(0, 0, 0), centering=(0.5, 0.5), ) diff --git a/examples/rgb_display_pillow_image.py b/examples/rgb_display_pillow_image.py index 1eb641c..b463106 100644 --- a/examples/rgb_display_pillow_image.py +++ b/examples/rgb_display_pillow_image.py @@ -86,7 +86,7 @@ else: scaled_width = width scaled_height = image.height * width // image.width -image = image.resize((scaled_width, scaled_height), Image.Resampling.BICUBIC) +image = image.resize((scaled_width, scaled_height), Image.BICUBIC) # Crop and center the image x = scaled_width // 2 - width // 2