summaryrefslogtreecommitdiff
path: root/addons/web/controllers/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/controllers/main.py')
-rw-r--r--addons/web/controllers/main.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index 8de78aebc2f..290e89e14e3 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -1104,13 +1104,13 @@ class Binary(http.Controller):
elif status != 200 and download:
return request.not_found()
- if content and width and height:
+ if content and (width or height):
# resize maximum 500*500
if width > 500:
width = 500
if height > 500:
height = 500
- content = openerp.tools.image_resize_image(base64_source=content, size=(width, height), encoding='base64', filetype='PNG')
+ content = openerp.tools.image_resize_image(base64_source=content, size=(width or None, height or None), encoding='base64', filetype='PNG')
image_base64 = content and base64.b64decode(content) or self.placeholder()
headers.append(('Content-Length', len(image_base64)))