diff options
author | luxagraf <sng@luxagraf.net> | 2018-07-07 20:41:09 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2018-07-07 20:41:09 -0400 |
commit | 6a2393e6819ea09aeb559354a69746750aa8cbdf (patch) | |
tree | 0ac9890740f9afcd9720ea9b550a3895d95ecb50 /app/photos/utils.py | |
parent | fe13c3830c6b36fb8f78009a788650a992cb3070 (diff) |
added campsite model, refactored some code to avoid circular imports,
reorganized some auxilary functions and fixed broken build JS.
Diffstat (limited to 'app/photos/utils.py')
-rw-r--r-- | app/photos/utils.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/photos/utils.py b/app/photos/utils.py index 28047d4..84e72f5 100644 --- a/app/photos/utils.py +++ b/app/photos/utils.py @@ -1,7 +1,12 @@ import os +import re import subprocess -from PIL import ImageFile +from django.apps import apps +from django.conf import settings + +from PIL import ImageFile +from bs4 import BeautifulSoup # pip install python-resize-image from resizeimage import resizeimage @@ -19,3 +24,5 @@ def resize_image(img, width=None, height=None, quality=72, base_path="", filenam ImageFile.MAXBLOCK = img.size[0] * img.size[1] * 4 newimg.save(path, newimg.format, quality=quality) subprocess.call(["jpegoptim", "%s" % path]) + + |