Skip to content

Commit bc4213e

Browse files
authored
Merge pull request #106 from nerdcorenet/example_animgif_resampling
Fix Pillow resampling change in rgb_display_pillow_animated_gif.py
2 parents 6e5234d + d5e1209 commit bc4213e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

examples/rgb_display_pillow_animated_gif.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
not support PIL/pillow (python imaging library)!
1414
1515
Author(s): Melissa LeBlanc-Williams for Adafruit Industries
16+
Mike Mallett <mike@nerdcore.net>
1617
"""
1718
import os
1819
import time
@@ -123,7 +124,7 @@ def preload(self):
123124
frame_object.image = ImageOps.pad( # pylint: disable=no-member
124125
image.convert("RGB"),
125126
(self._width, self._height),
126-
method=Image.NEAREST,
127+
method=Image.Resampling.NEAREST,
127128
color=(0, 0, 0),
128129
centering=(0.5, 0.5),
129130
)

examples/rgb_display_pillow_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
else:
8585
scaled_width = width
8686
scaled_height = image.height * width // image.width
87-
image = image.resize((scaled_width, scaled_height), Image.BICUBIC)
87+
image = image.resize((scaled_width, scaled_height), Image.Resampling.BICUBIC)
8888

8989
# Crop and center the image
9090
x = scaled_width // 2 - width // 2

0 commit comments

Comments
 (0)