summaryrefslogtreecommitdiff
path: root/addons/web_editor/controllers/main.py
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2016-03-03 10:48:57 +0100
committerNicolas Martinelli <nim@odoo.com>2016-03-03 13:24:40 +0100
commitfad47882722408a120ecfcd88b3ff650d4e09d2f (patch)
treea72b605861c8263e9cc09cd51aa46323f540fee1 /addons/web_editor/controllers/main.py
parentdb95dcd8bc593f1c232277bf7149c4c5a2baa4a7 (diff)
[FIX] web_editor: image size
Make sure to create an image of a size larger than zero. A size of zero will generate a traceback.
Diffstat (limited to 'addons/web_editor/controllers/main.py')
-rw-r--r--addons/web_editor/controllers/main.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/web_editor/controllers/main.py b/addons/web_editor/controllers/main.py
index 24fb6064dcb..963a78488ce 100644
--- a/addons/web_editor/controllers/main.py
+++ b/addons/web_editor/controllers/main.py
@@ -84,6 +84,8 @@ class Web_Editor(http.Controller):
:returns PNG image converted from given font
"""
+ # Make sure we have at least size=1
+ size = max(1, size)
# Initialize font
addons_path = http.addons_manifest['web']['addons_path']
font_obj = ImageFont.truetype(addons_path + font, size)