summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/views/editor_helpers.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/views/editor_helpers.py b/core/views/editor_helpers.py
index e0ff5cd..960d6cf 100644
--- a/core/views/editor_helpers.py
+++ b/core/views/editor_helpers.py
@@ -12,10 +12,10 @@ import troggle.settings as settings
from troggle.lib import version_control
MAX_IMAGE_WIDTH = 1000
-MAX_IMAGE_HEIGTH = 800
+MAX_IMAGE_HEIGHT = 800
THUMBNAIL_WIDTH = 200
-THUMBNAIL_HEIGTH = 200
+THUMBNAIL_HEIGHT = 200
def image_selector(request, path):
'''Returns available images'''
@@ -48,10 +48,10 @@ def new_image_form(request, path):
binary_data.write(chunk)
i = Image.open(binary_data)
width, height = i.size
- if width > MAX_IMAGE_WIDTH or height > MAX_IMAGE_HEIGTH:
- scale = max(width / MAX_IMAGE_WIDTH, height / MAX_IMAGE_HEIGTH)
+ if width > MAX_IMAGE_WIDTH or height > MAX_IMAGE_HEIGHT:
+ scale = max(width / MAX_IMAGE_WIDTH, height / MAX_IMAGE_HEIGHT)
i = i.resize((int(width / scale), int(height / scale)), Image.ANTIALIAS)
- tscale = max(width / THUMBNAIL_WIDTH, height / THUMBNAIL_HEIGTH)
+ tscale = max(width / THUMBNAIL_WIDTH, height / THUMBNAIL_HEIGHT)
thumbnail = i.resize((int(width / tscale), int(height / tscale)), Image.ANTIALIAS)
ib = io.BytesIO()
i.save(ib, format="png")