# Change rotation of images

**URL:** <https://forum.litium.com/t/change-rotation-of-images/287>\
**Category:** Questions\
**Tags:** litium-6, accelerator\
**Created:** [October 15, 2018, 11:38am UTC](https://forum.litium.com/t/change-rotation-of-images/287 "2018-10-15T11:38:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cissi](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/cissi/32/18_2.png) [@Cissi](https://forum.litium.com/u/Cissi)\
**Post date:** [October 15, 2018, 11:38am UTC](https://forum.litium.com/t/change-rotation-of-images/287/1 "2018-10-15T11:38:52Z")

</div>

We have some images that has been uploaded and has the wrong orientation, the exif orientation is “Left side, bottom (Rotate 270 CW)” but it should be “Top, left side (Horizontal / normal)”. Is there any way I can just fix this by code? I’ve tried to update just the metadata value for the orientation, but it dosent matter. Do I need to search for all with the value, download and edit and upload it again?

Litium version: 6.2.2-patch-1810041453

---

<div class="post-metadata">

**Author:** ![ton.nguyen](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/ton.nguyen/32/989_2.png) [@ton.nguyen](https://forum.litium.com/u/ton.nguyen)\
**Post date:** [October 15, 2018, 2:42pm UTC](https://forum.litium.com/t/change-rotation-of-images/287/2 "2018-10-15T14:42:01Z")

</div>

Orientation Exif is unfortunately not taken into account when uploading images. So I would suggest to edit the file and use the Replace file feature to replace the blob.

---

<div class="post-metadata">

**Author:** ![Cissi](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/cissi/32/18_2.png) [@Cissi](https://forum.litium.com/u/Cissi)\
**Post date:** [October 16, 2018, 12:22pm UTC](https://forum.litium.com/t/change-rotation-of-images/287/3 "2018-10-16T12:22:43Z")

</div>

But if Litium isnt taken the exif orientation in account when uploading, why is the images rotated?  
I have several images, and when I look at them in the file explorer they are rotated right. I upload them and they get rotated wrong. The only thing I can find on the image is the exif roation.

---

<div class="post-metadata">

**Author:** ![ton.nguyen](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/ton.nguyen/32/989_2.png) [@ton.nguyen](https://forum.litium.com/u/ton.nguyen)\
**Post date:** [October 16, 2018, 1:02pm UTC](https://forum.litium.com/t/change-rotation-of-images/287/4 "2018-10-16T13:02:11Z")

</div>

Could you share one example of the photo? Could it be that the file explorer automatically rotates the photo?

---

<div class="post-metadata">

**Author:** ![Cissi](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/cissi/32/18_2.png) [@Cissi](https://forum.litium.com/u/Cissi)\
**Post date:** [October 23, 2018, 2:11pm UTC](https://forum.litium.com/t/change-rotation-of-images/287/6 "2018-10-23T14:11:01Z")

</div>

Here is aa image example  
[https://dev.cyberphoto.se/storage/A7CEB091A61E82C4F7040F205829573D6A9B547D4FA669ECDD8D8BBFC1859B4A/39454eceb34a45e098b91fe63cda8450/JPG/media/7ed362710af241b49657a9b8004e700b/TEST\_A7mk3-product\_4.JPG](https://dev.cyberphoto.se/storage/A7CEB091A61E82C4F7040F205829573D6A9B547D4FA669ECDD8D8BBFC1859B4A/39454eceb34a45e098b91fe63cda8450/JPG/media/7ed362710af241b49657a9b8004e700b/TEST_A7mk3-product_4.JPG)

---

<div class="post-metadata">

**Author:** ![ton.nguyen](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/ton.nguyen/32/989_2.png) [@ton.nguyen](https://forum.litium.com/u/ton.nguyen)\
**Post date:** [October 23, 2018, 3:18pm UTC](https://forum.litium.com/t/change-rotation-of-images/287/7 "2018-10-23T15:18:39Z")

</div>

Thanks! It turns out that Windows explorer (if you are using Windows) and browsers like Chrome and Firefox automatically rotate the image based on the Exif orientation info to show you the image in the correct orientation. If you try to open the link you sent above in IE 11, you will see that IE does not rotate the image.

What Litium is doing is read the stream and save the blob, no rotation based on exif info. So either you can:

1. Rotate the image manually then upload it again
2. Implement a custom IImageResizer (under Litium.Studio.Plugins.ImageResizer namespace) to rotate the image when a request of render/resize the image happens. For example: bitmap.RotateFlip(RotateFlipType.Rotate270FlipNone);
3. File a bug 🙂
