<p>After some mail exchanges with Brad and Andris from Craft CMS, it turned out that there is an edge case where the image rotation on upload will not work if the EXIF extension is not installed (which was our case).</p>

<p>There are two solutions to fix this problem:</p>

<ol>
<li>Install EXIF extension</li>
<li>Install and use Imagick instead of GD.</li>
</ol>

<p>As Imagick is the recommended image extension for Craft, we ended up installing Imagick on the server.</p>

<p>This is already working with Imagick on Craft 3, and will soon be working on Craft 2 with the next update (> v2.6.2954).</p>

CC BY-SA 3.0
2016-12-21T14:24:06.017Z
2016-12-21T14:24:06.017Z
kant312
<p>The Craft CMS instance where I noticed this is running version 2.6, but I updated it last month from version 2.2.</p>

<p>While we did not notice any problem, according to the client, they were able to upload pictures taken with their smartphone and Craft would rotate the images correctly before the update.</p>

<p>As far as I can tell, Imagick is not available on this server (I checked PHPInfo) so GD has always been used. I also made sure that the "rotateImagesOnuploadByExifData" setting is set to true by adding it explicitly to the general config.</p>

<p>Any idea what could be causing the issue and would installing Imagick solve the problem?</p>

CC BY-SA 3.0
2016-11-29T19:08:00.633Z
Any chance the client was mistaken? :)
Brad Bell
CC BY-SA 3.0
2016-11-30T08:14:22.523Z
We definitely cannot rule that out ;) Still, even if there was no problem before, the pictures are not rotated now :[
kant312
CC BY-SA 3.0
2016-11-30T21:56:19.957Z
Fair enough... can you send one of the images over to support@craftcms.com and reference this thread so we can try to reproduce?
Brad Bell
CC BY-SA 3.0
2016-12-10T13:51:36.533Z
For anyone else looking at this, I had a similar problem and the cause was I have the imageresizer plugin installed and it was resizing the image and stripping the exif data before Craft got to check the exif data.
Paul Frost
<image><upload><imagick>
Images containing EXIF orientation tag are not rotated on upload
# Images containing EXIF orientation tag are not rotated on upload

(Asked by: username_0 on 2016-11-29)

The Craft CMS instance where I noticed this is running version 2.6, but I updated it last month from version 2.2.

While we did not notice any problem, according to the client, they were able to upload pictures taken with their smartphone and Craft would rotate the images correctly before the update.

As far as I can tell, Imagick is not available on this server (I checked PHPInfo) so GD has always been used. I also made sure that the "rotateImagesOnuploadByExifData" setting is set to true by adding it explicitly to the general config.

Any idea what could be causing the issue and would installing Imagick solve the problem?

**Tags:** image, upload, imagick

> **Comments:**
> **username_1**: Any chance the client was mistaken? :)  
> **username_0**: We definitely cannot rule that out ;) Still, even if there was no problem before, the pictures are not rotated now :[  
> **username_1**: Fair enough... can you send one of the images over to support@craftcms.com and reference this thread so we can try to reproduce?  
> **username_2**: For anyone else looking at this, I had a similar problem and the cause was I have the imageresizer plugin installed and it was resizing the image and stripping the exif data before Craft got to check the exif data.  

---

## 1 answers

### Answer by username_0 on 2016-12-21. Score: 5 | Accepted answer

After some mail exchanges with Brad and Andris from Craft CMS, it turned out that there is an edge case where the image rotation on upload will not work if the EXIF extension is not installed (which was our case).

There are two solutions to fix this problem:

1. Install EXIF extension
2. Install and use Imagick instead of GD.

As Imagick is the recommended image extension for Craft, we ended up installing Imagick on the server.

This is already working with Imagick on Craft 3, and will soon be working on Craft 2 with the next update (> v2.6.2954).


---

