From c2118a8b9cd8c9c91135c6e178830b89b40867be Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 5 Aug 2023 17:08:28 +0200 Subject: [PATCH] Fix compatibility with pillow 10 The `ANTIALIAS` attribute has long been deprecated, and was finally removed in pillow 10.0. The recommendation is to migrate to `Resampling.LANCZOS` instead. --- beets/util/artresizer.py | 2 +- docs/changelog.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/beets/util/artresizer.py b/beets/util/artresizer.py index 2ef41f087..1a13f64ef 100644 --- a/beets/util/artresizer.py +++ b/beets/util/artresizer.py @@ -353,7 +353,7 @@ class PILBackend(LocalBackend): try: im = Image.open(syspath(path_in)) size = maxwidth, maxwidth - im.thumbnail(size, Image.ANTIALIAS) + im.thumbnail(size, Image.Resampling.LANCZOS) if quality == 0: # Use PIL's default quality. diff --git a/docs/changelog.rst b/docs/changelog.rst index 8688669e5..ea4a628b6 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -107,6 +107,8 @@ New features: * :doc:`plugins/importfeeds`: Add a new output format allowing to save a playlist once per import session. :bug: `4863` +* Make ArtResizer work with :pypi:`PIL`/:pypi:`pillow` 10.0.0 removals. + :bug:`4869` Bug fixes: