Skip to content

Commit

Permalink
Merge pull request #3784 from jackwilsdon/fix-pil-image-quality
Browse files Browse the repository at this point in the history
Fix PIL image quality
  • Loading branch information
sampsyo authored Oct 28, 2020
2 parents 769e424 + f2dabfe commit be0003a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions beets/util/artresizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit be0003a

Please sign in to comment.