From 01ed58827862870dcf9b2a4679c8c93b5d7fb630 Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Sun, 20 Sep 2020 16:16:10 +0200 Subject: [PATCH] textures: work around old pillow Older versions apparently didn't have LANCZOS filtering for resizing. In this case, just fall back to whatever the default is. Will look marginally worse for those people but at least it works. --- overviewer_core/textures.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/overviewer_core/textures.py b/overviewer_core/textures.py index 0c470b2..be0243b 100644 --- a/overviewer_core/textures.py +++ b/overviewer_core/textures.py @@ -2755,7 +2755,10 @@ def grindstone(self, blockid, data): alpha_over(img_pivot, pivot_lr_t, (24, 24), pivot_lr_t) alpha_over(img_pivot, img_leg, pos_leg, img_leg) alpha_over(img_pivot, pivot_outer_t, (21, 21), pivot_outer_t) - img_pivot = img_pivot.resize((24, 24), Image.LANCZOS) + if hasattr(Image, "LANCZOS"): # workaround for older Pillow + img_pivot = img_pivot.resize((24, 24), Image.LANCZOS) + else: + img_pivot = img_pivot.resize((24, 24)) # Combine leg, side, round & pivot img = Image.new("RGBA", (24, 24), self.bgcolor)