Merge pull request #3784 from jackwilsdon/fix-pil-image-quality

Fix PIL image quality
This commit is contained in:
Adrian Sampson 2020-10-28 15:16:59 -04:00 committed by GitHub
commit be0003aba3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

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

View file

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