Update to follow Pillow evolution

This commit is contained in:
Darks 2022-12-17 22:11:36 +01:00
parent 112d06e3d6
commit 2089398773
Signed by untrusted user: Darks
GPG Key ID: 7515644268BE1433
1 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@ import yaml
import slugify
import readline
from PIL import Image
from PIL.Image import Resampling
help_msg = """
@ -269,7 +270,7 @@ def generate_trophy_icons():
icon = img.crop((26*x+1, 26*y+1, 26*x+25, 26*y+25))
# Skip blank squares in the source image
if len(icon.getcolors()) > 1:
yield icon.resize((48,48), resample=Image.NEAREST)
yield icon.resize((48,48), resample=Resampling.NEAREST)
for (name, icon) in zip(names, trophy_iterator(img)):
icon.save(os.path.join(dst, f"{name}.png"))