My site is using the Corolla responsive theme.
I uploaded a portrait image to my site from my iPhone and it displayed as landscape in a view.
I didn't have anything in the view to turn it from one orientation to the other. The field formatter in the view was "image" and the image style was the default Drupal style "large (480x480)".
If I viewed the image on its own node page on the iPhone it appeared correctly in portrait orientation.
On the desktop version of the site, the "portrait" image appeared in landscape orientation both within the view AND on its own node page.
I tried uploading a second portrait image exactly the same way and the same thing happened.
These two images when inspected on my PC are 1632x1224, which this site says has an aspect ratio of 1.33:1.
I tried a third, cropped portrait image from the iPhone and it appeared as portrait everywhere. This one is 1268x1622 (0.78:1).
At this point I found the Imagecache Actions module and tried to work out how to rotate portrait images incorrectly rendered as landscape, without affecting normal landscape images. I don't know if it's possible to do this but I tried nonetheless.
I created an image preset with the aspect switcher effect set as follows:
Style to use if image is portrait = none
Style to use if image is landscape = "large landscape"
The "large landscape" preset rotates the image 90 degrees clockwise and scales the width to 480px.
With "ratio adjustment" left at 1, the effect is that the iPhone "portrait" images which showed as landscape are now rotated and shown correctly, but actual landscape images also get rotated 90 degrees.
Setting the ratio adjustment to .9 or 1.1 or 1.33 has the same effect.
Setting it to 0.33 or 0.6 doesn't rotate either of them.
Setting it to 3 or 4 or 10 or 100 rotates all photos 90 degrees, including normal portraits.
Thus I don't know if there is a magic formula which will do what I want or not. I don't know if it's the ratio adjustment that needs configuring, or the new preset, or both.
Any help would be HUGELY appreciated!
Comments
Comment #1
fietserwinEnable the auto-rotate submodule and add the auto-rotate effect to (the beginning of) the image style. The help of that effect explains what is happening.
Note: when you resize uploaded images before applying a style (setting of an image field), the exif data may be lost, so it may be better to never resize images on upload.
Comment #2
thoughtcat commentedOK thanks, I'll try that - I did actually attempt to enable that submodule but got "The exif_read_data() function is not available in this PHP installation. You probably will have to enable the exif extension." and had no luck configuring that on my WHM cPanel initially... will give it another go.