diff options
Diffstat (limited to 'app/photos/utils.py')
-rw-r--r-- | app/photos/utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/photos/utils.py b/app/photos/utils.py index 6cc64a3..e880277 100644 --- a/app/photos/utils.py +++ b/app/photos/utils.py @@ -1,4 +1,7 @@ import os +import subprocess + +# pip install python-resize-image from resizeimage import resizeimage @@ -13,3 +16,4 @@ def resize_image(img, width=None, height=None, quality=72, base_path="", filenam os.makedirs(base_path) path = "%s%s" % (base_path, filename) newimg.save(path, newimg.format, quality=quality) + subprocess.call(["jpegoptim", "%s" % path]) |