diff --git a/beets/util/artresizer.py b/beets/util/artresizer.py index 8f14c8baf..c57918f16 100644 --- a/beets/util/artresizer.py +++ b/beets/util/artresizer.py @@ -77,6 +77,11 @@ def pil_resize(maxwidth, path_in, path_out=None, quality=0): im = Image.open(util.syspath(path_in)) size = maxwidth, maxwidth im.thumbnail(size, Image.ANTIALIAS) + + if quality == 0: + # Use PIL's default quality. + quality = -1 + im.save(util.py3_path(path_out), quality=quality) return path_out except IOError: diff --git a/docs/changelog.rst b/docs/changelog.rst index e65e6b1e9..a530cbac1 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -266,6 +266,8 @@ Fixes: the current track in the queue. Thanks to :user:`aereaux`. :bug:`3722` +* Fix a bug causing PIL to generate poor quality JPEGs when resizing artwork. + :bug:`3743` For plugin developers: