summaryrefslogtreecommitdiff
path: root/odoo/addons/base/wizard/base_document_layout.py
diff options
context:
space:
mode:
authorSébastien Theys <seb@odoo.com>2019-10-11 16:38:55 +0000
committerfw-bot <otis@odoo.com>2019-10-14 13:03:03 +0000
commit3c3f0753da26d8e6df522f795501e2686852709c (patch)
treee58abfa54b49d769566fa185924312840a10bf2c /odoo/addons/base/wizard/base_document_layout.py
parent728e23877f273a92044d97fc781690e276820a7a (diff)
[FIX] tools, base: fix orientation of image with EXIF orientation tag
Before this commit, some images would display incorrectly orientated. This typically happens for images taken from a non-standard orientation by some phones or other devices that are able to report orientation. The specified transposition is applied to the image before all other operations, because all of them expect the image to be in its final orientation, which is the case only when the first row of pixels is the top of the image and the first column of pixels is the left of the image. Moreover the EXIF tags will not be kept when the image is later saved, so the transposition has to be done to ensure the final image is correctly orientated. closes odoo/odoo#38717 X-original-commit: 0f8e132ec0495fcdfa0a47d5b9c98a2f6f10c7d8 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'odoo/addons/base/wizard/base_document_layout.py')
-rw-r--r--odoo/addons/base/wizard/base_document_layout.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/addons/base/wizard/base_document_layout.py b/odoo/addons/base/wizard/base_document_layout.py
index e41ed375d90..d380c1c49a6 100644
--- a/odoo/addons/base/wizard/base_document_layout.py
+++ b/odoo/addons/base/wizard/base_document_layout.py
@@ -137,7 +137,7 @@ class BaseDocumentLayout(models.TransientModel):
logo += b'===' if type(logo) == bytes else '==='
try:
# Catches exceptions caused by logo not being an image
- image = tools.base64_to_image(logo)
+ image = tools.image_fix_orientation(tools.base64_to_image(logo))
except Exception:
return False, False