Fix PIL image quality

This commit is contained in:
Jack Wilsdon 2020-10-25 16:21:28 +00:00
parent 6e4bb3d4ed
commit f2dabfef53
No known key found for this signature in database
GPG key ID: D657C01A7BC820AE
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

@ -265,6 +265,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: