summaryrefslogtreecommitdiff
path: root/addons/web/controllers
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-05-23 19:33:40 +0200
committerChristophe Simonis <chs@odoo.com>2018-05-23 19:33:40 +0200
commit2bc6ea1b378bc8a660219b0502c93118f0bb1b6a (patch)
tree806acef55473ca422ca6f1d5d46041e3c5e1e590 /addons/web/controllers
parent2a43614c3c00d57a4376eea44cd8cd1ed2d316b7 (diff)
parent02ee3fd88eff00ecc058c060aa9b3b39b7c08e15 (diff)
[MERGE] forward port branch 11.0 up to 02ee3fd88ef
Diffstat (limited to 'addons/web/controllers')
-rw-r--r--addons/web/controllers/main.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index 77d7304df12..f05a3855ab8 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -1047,8 +1047,12 @@ class Binary(http.Controller):
elif status != 200 and download:
return request.not_found()
- height = int(height or 0)
- width = int(width or 0)
+ if headers and dict(headers).get('Content-Type', '') == 'image/svg+xml': # we shan't resize svg images
+ height = 0
+ width = 0
+ else:
+ height = int(height or 0)
+ width = int(width or 0)
if crop and (width or height):
content = crop_image(content, type='center', size=(width, height), ratio=(1, 1))