简体   繁体   English

xml表单上的Odoo 8图像旋转

[英]Odoo 8 image on xml form rotated

I'm using Odoo V8 and added an image widget on the XML form. 我正在使用Odoo V8,并在XML表单上添加了一个图像小部件。 Now this image is always 90° rotated, however in windows this appears normal. 现在,此图像始终旋转90°,但是在窗口中看起来很正常。 I suppose that the orignal image was taken sideways and windows auto-rotates this and Odoo takes the original orientation. 我认为原始图像是横向拍摄的,窗户会自动旋转该图像,而Odoo会采用原始​​方向。 I can't seem to find a way to rotate this image and upload it. 我似乎找不到旋转此图像并上传它的方法。 I was wondering if there was a possibility to rotate this image in Odoo itself, through a JS-script maybe? 我想知道是否有可能通过JS脚本在Odoo本身中旋转此图像?

Any ideas welcome. 任何想法欢迎。

That's because when you take a picture it is stored with some metadata, where the orientation is stored. 这是因为拍摄照片时,它会与一些元数据一起存储,而元数据会存储在其中。 Check this article about the EXIF format on Wikipedia . 在Wikipedia上查看有关EXIF格式的本文 So before upload the image you should rotate it physically (without the metadata about orientation) with any Photo Editing program such as Photoshop or ACDSee. 因此,在上传图像之前,您应该使用Photoshop或ACDSee之类的任何Photo Editing程序对其进行物理旋转(没有关于方向的元数据)。

So you need some program to rotate the images. 因此,您需要一些程序来旋转图像。 If you read this other question George says: 如果您阅读其他问题,乔治会说:

I am pretty certain there is no way to rotate images based on EXIF info using only standard apps that come with Windows. 我敢肯定,仅使用Windows随附的标准应用程序就无法根据EXIF信息旋转图像。

Anyway you can also use CSS to rotate the div that contains the images. 无论如何,您也可以使用CSS旋转包含图像的div。 But I think it's not the appropiate way to do it in this case 但我认为在这种情况下这不是合适的方法

div {
    /* Rotate div */
    -ms-transform: rotate(90deg); /* IE 9 */
    -webkit-transform: rotate(90deg); /* Safari 3-8 */
    transform: rotate(90deg);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM