Skip to content

Commit

Permalink
Fix Pillow 10 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Aug 8, 2023
1 parent 612f693 commit bc90b95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hasjob/uploads.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def process_image(requestfile, maxsize=(170, 130)):
raise UploadNotAllowed("This image is too large to process")
img.load()
if img.size[0] > maxsize[0] or img.size[1] > maxsize[1]:
img.thumbnail(maxsize, Image.ANTIALIAS)
img.thumbnail(maxsize, Image.LANCZOS)
boximg = Image.new(img.mode, maxsize, '#fff0')
boximg.paste(
img, ((boximg.size[0] - img.size[0]) // 2, (boximg.size[1] - img.size[1]) // 2)
Expand Down

0 comments on commit bc90b95

Please sign in to comment.