From 5e855453aec55b136685828aa214dd7b4192b786 Mon Sep 17 00:00:00 2001 From: ThanhDodeurOdoo Date: Tue, 4 Sep 2018 09:15:12 +0200 Subject: [PATCH] [FIX] web: web/image route image type fix - the http route, when given width and height arguments is no longer forcing the type PNG (which resulted in heavier images than the original). --- addons/web/controllers/main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 424ba3b8910..1719b70f6f8 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1077,10 +1077,8 @@ class Binary(http.Controller): if height > 500: height = 500 content = odoo.tools.image_resize_image(base64_source=content, size=(width or None, height or None), - encoding='base64', filetype='PNG', upper_limit=upper_limit, + encoding='base64', upper_limit=upper_limit, avoid_if_small=avoid_if_small) - # resize force png as filetype - headers = self.force_contenttype(headers, contenttype='image/png') if content: image_base64 = base64.b64decode(content)