Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hvzsite/hvz/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def resize_image(photo, width, height, format="JPEG"):
output = BytesIO()
im = im.convert('RGB')
#Resize/modify the image
im.thumbnail( (width,height) , Image.ANTIALIAS )
im.thumbnail( (width,height) , Image.Resampling.LANCZOS )
#after modifications, save it to the output
im.save(output, format=format, quality=95)
output.seek(0)
Expand Down
2 changes: 1 addition & 1 deletion hvzsite/hvz/views_api_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def player_activation_rest(request):
img = Image.open(im_file) # img is now PIL Image object
output = BytesIO()
im = img.convert('RGB')
im.thumbnail( (400, 400) , Image.ANTIALIAS )
im.thumbnail( (400, 400) , Image.Resampling.LANCZOS )
im.save(output, format="JPEG", quality=95)
output.seek(0)
requested_player.picture = InMemoryUploadedFile(output,'ImageField', "%s.jpg" % requested_player.player_uuid, 'image/jpeg', sys.getsizeof(output), None)
Expand Down