tako的任务是如何压缩通过django-summernote上传的图像例如,我下载后的图片大小为5mb,应该大小为500kb
Edit the paths as you wish and choose one of the two when finished:
from PIL import Image
foo = Image.open("path to image")
foo = foo.resize((720, 405), Image.ANTIALIAS)
foo.save("path to first new image", quality=95)
foo.save("path to second new image", optimize=True, quality=95)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.