0

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.
This commit is contained in:
Nicolas F
2020-09-20 16:16:10 +02:00
parent 91ea87447a
commit 01ed588278

View File

@@ -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)
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)