更新时间:2023-02-05 22:46:10
手动使用PIL的resize
方法:
Use PIL's resize
method manually:
image = image.resize((x, y), Image.ANTIALIAS) # LANCZOS as of Pillow 2.7
接着是保存方法
quality_val = 90
image.save(filename, 'JPEG', quality=quality_val)
Take a look at the source for models.py
from Photologue to see how they do it.