2

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?

4
  • Any chance the client was mistaken? :)
    – Brad Bell
    Commented Nov 29, 2016 at 19:08
  • We definitely cannot rule that out ;) Still, even if there was no problem before, the pictures are not rotated now :[
    – kant312
    Commented Nov 30, 2016 at 8:14
  • Fair enough... can you send one of the images over to [email protected] and reference this thread so we can try to reproduce?
    – Brad Bell
    Commented Nov 30, 2016 at 21:56
  • 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
    Commented Dec 10, 2016 at 13:51

1 Answer 1

5

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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.