Use pil lanczos.

This commit is contained in:
voussoir 2022-08-03 18:49:27 -07:00
parent 4e1ef81c20
commit 12bf381fa2
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB
2 changed files with 2 additions and 2 deletions

View file

@ -1,6 +1,6 @@
BSD 3-Clause License
Copyright (c) 2021, Ethan Dalool aka voussoir
Copyright (c) 2022, Ethan Dalool aka voussoir
All rights reserved.
Redistribution and use in source and binary forms, with or without

View file

@ -94,7 +94,7 @@ def imagecrunch(book, options):
data = io.BytesIO()
# i = i.convert('L')
new_dimension = fit_into_bounds(*i.size, options['max_dimension'], options['max_dimension'], only_shrink=True)
i = i.resize(new_dimension, resample=PIL.Image.ANTIALIAS)
i = i.resize(new_dimension, resample=PIL.Image.LANCZOS)
i.save(data, format='jpeg', quality=options['quality'])
data.seek(0)
new_size = len(data.read())