summaryrefslogtreecommitdiff
path: root/addons/web
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web')
-rw-r--r--addons/web/controllers/main.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index 13f0124e3d9..b15247f1ccd 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -1532,7 +1532,10 @@ class Binary(http.Controller):
if not (width or height):
width, height = odoo.tools.image_guess_size_from_field_name(field)
- image_base64 = image_process(image_base64, size=(int(width), int(height)), crop=crop, quality=int(quality))
+ try:
+ image_base64 = image_process(image_base64, size=(int(width), int(height)), crop=crop, quality=int(quality))
+ except Exception:
+ return request.not_found()
content = base64.b64decode(image_base64)
headers = http.set_safe_image_headers(headers, content)