Skip to content

Commit

Permalink
fix deprecated attribute in PIL
Browse files Browse the repository at this point in the history
  • Loading branch information
bojieli committed May 22, 2024
1 parent ee04b4f commit 2c1dfb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def resize_avatar(old_file):
# generate thumbnail if the avatar is too large
new_filename = rand_str() + '.png'
try:
img.thumbnail((thumbnail_width, thumbnail_height), Image.ANTIALIAS)
img.thumbnail((thumbnail_width, thumbnail_height), Image.LANCZOS)
img.save(os.path.join(upload_base, new_filename), "PNG")
except IOError:
print("Failed to create thumbnail from '" + old_file + "' to '" + new_filename + "'")
Expand Down

0 comments on commit 2c1dfb4

Please sign in to comment.