summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/xml
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2018-02-23 12:29:25 +0100
committerNicolas Martinelli <nim-odoo@users.noreply.github.com>2018-02-26 08:24:08 +0100
commite2c2a2fc696a12d3fdd697e5da5354437a290047 (patch)
tree4a8277d11f9a22c1ce9058e4beee7278ec388ef4 /addons/mail/static/src/xml
parenta16013be6636db58a4252fafd67033c6643a1e48 (diff)
[FIX] mail: rotate image in preview
When uploading an image as attachment, the document viewer doesn't support the EXIF data. Therefore, a picture taken with a non-zero angle will not appear with the right orientation (preview or full-size image). Unfortunately, supporting EXIF data is not trivial in Python or JavaScript without external libraries. Therefore, we add a rotate button which allows the user to rotate the image by 90°. Moreover, we add the `image-orientation: from-image` CSS property, which is only supported by Firefox. opw-1814407
Diffstat (limited to 'addons/mail/static/src/xml')
-rw-r--r--addons/mail/static/src/xml/thread.xml5
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/mail/static/src/xml/thread.xml b/addons/mail/static/src/xml/thread.xml
index 6f5f5e71cfe..8408e149113 100644
--- a/addons/mail/static/src/xml/thread.xml
+++ b/addons/mail/static/src/xml/thread.xml
@@ -51,6 +51,11 @@
<div t-if="widget.activeAttachment.type == 'image'" class="o_viewer_toolbar">
<ul class="list-inline">
<li>
+ <a class="o_rotate" href="#">
+ <i class="fa fa-2x fa-repeat"></i>
+ </a>
+ </li>
+ <li>
<a class="o_zoom_out" href="#">
<i class="fa fa-2x fa-search-minus"></i>
</a>