# Is there a way to manually rotate an image

**URL:** <https://meta.discourse.org/t/is-there-a-way-to-manually-rotate-an-image/70834>\
**Category:** Product Support\
**Created:** [26 september 2017 om 21:26 UTC](https://meta.discourse.org/t/is-there-a-way-to-manually-rotate-an-image/70834 "2017-09-26T21:26:17Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)\
**Post date:** [10 oktober 2017 om 19:11 UTC](https://meta.discourse.org/t/is-there-a-way-to-manually-rotate-an-image/70834/9 "2017-10-10T19:11:35Z")

</div>

I’ve run across some photo hosting players that do handle this issue. It is possible, but someone would have to take the time to write a plugin or implement the functionality into an official Discourse release. I’m still learning my way around Discourse development, but for a future, more educated me, or someone else interested in trying to come up with something, I may have found something to look at for inspiration.

[This article](https://www.engadget.com/2010/02/17/fix-iphone-exif-rotation-on-the-command-line/) explains the issue and points to [jhead](http://www.sentex.net/~mwandel/jhead/), a public domain EXIF manipulation tool that runs on a command line. My understanding is that most of the problems with undesirable rotation stem from the rotation tag in a JPEG’s EXIF header There’s an option listed in the documentation that looks like it does the trick:

> **-autorot** Using the ‘Orientation’ tag of the Exif header, rotate the image so that it is upright. The program ‘jpegtran’ is used to perform the rotation. This program is present in most Linux distributions. For windows, you need to get a copy of it. After rotation, the orientation tag of the Exif header is set to ‘1’ (normal orientation). The Exif thumbnail is also rotated. Other fields of the Exif header, including dimensions are untouched, but the JPEG height/width are adjusted.  
> This feature is especially useful with newer digital cameras, which set the orientation field in the Exif header automatically using a built in orientation sensor in the camera.

The stripping of EXIF info that happens upon uploading an image on Discourse may be the culprit. I looked at the EXIF data on one of the photos @codinghorror provided and there is no orientation tag. I think modern browsers might depend on that. I’m not certain this is the case, but that’s another area to check. It might just be a matter of retaining that tag.

---

_[View the full topic](https://meta.discourse.org/t/is-there-a-way-to-manually-rotate-an-image/70834)._
