From b6288e54461426d7aac6cfc549cee3e90309a093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Thu, 19 Sep 2019 10:23:39 +0000 Subject: [IMP] *: remove image_64 and clean views MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are too many image sizes. Since they are stored resized this takes time to generate when saving a new image, it's more rows on the attachment table, more files on the disk, ... 64px is close enough to 128px that it can be removed without a big impact on download size. It will even reduce download and number of requests when both images are displayed because now only one has to be downloaded and then benefit from cache. The difference between the two is typically around 1.5kB which is negligible these days, especially when the request overhead is around 0.5kB already, not even taking into account other factors such as latency. If a 64px image must absolutely be returned, it is still possible to pass the size parameters to the image route. But the current guideline is to handle resizing in the views when necessary. Views ===== - remove width and height attributes when existing CSS rules are overriding them (eg. `.oe_kanban_avatar` in the right context) - add CSS rules instead of width and height attributes when possible - use `object-fit: cover;` where width and height are forced to avoid distortion of non-square images - for products, use `object-fit: contain;` instead, keep ratio but without crop - add new CSS rules where the expected size was max 64px*64px before due to the image size itself - remove `img-fluid` where using size classes to avoid conflicting rules task-2060865 closes odoo/odoo#36147 Signed-off-by: Sébastien Theys (seb) --- addons/mail/static/src/js/composers/basic_composer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/mail/static/src/js/composers/basic_composer.js') diff --git a/addons/mail/static/src/js/composers/basic_composer.js b/addons/mail/static/src/js/composers/basic_composer.js index d79a7c93028..bfd97028a2d 100644 --- a/addons/mail/static/src/js/composers/basic_composer.js +++ b/addons/mail/static/src/js/composers/basic_composer.js @@ -100,7 +100,7 @@ var BasicComposer = Widget.extend({ this.avatarURL = session.uid > 0 ? session.url('/web/image', { model: 'res.users', - field: 'image_64', + field: 'image_128', id: session.uid, }) : '/web/static/src/img/user_menu_avatar.png'; }, -- cgit v1.2.3