Usually the photo was taken "lying down", and the correct orientation marked on the tag orientation
of EXIF.
The problem is that the photo is actually recorded "lying down" depending on the device (most commonly mobile phones and tablets), and is only "noted" in the said tag which is the correct orientation.
The consequence is what you realized in your application. In certain viewers, the image appears in the correct orientation, however, depending on the browser it will appear "lying down", because the EXIF tag is ignored in certain situations, and in others not.
The solution is to open the images in some graphical application, and correct the position. Preferably by eliminating the orientation of the EXIF, not to cause further ambiguities.
This is an image that has EXIF orientation. Click it to view outside the <img>
, and test in more than one browser:
A good test is to save on the PC and check the thumbnails, and open in different software, to see how inconsistent the behavior of the tag.
In IE11, for example, always appears lying down.
In Opera 34 appears lying in the post, but in separate tab appears standing. Already in Opera12, appears lying in any situation.
In the Windows 7 viewer and thumbnails, lie down.
That same photo that was saved in Windows 7 and is appearing lying, while opening with Photoshop CS6 appears standing.
Probably the original photo is actually lying down, and the PC viewer is automatically rotating based on the image orientation flag, but the browser is not.
– Bacco
If that is the case, your Application has no limitation as to the version of the browsers that will view it and reprocess each image is a hindrance, the Transform property CSS3 can break a branch.
– Bruno Augusto
One way to solve without having to modify the image is to get Exif via Javascript and detect whether or not to rotate. A similar question in SO-en: http://stackoverflow.com/questions/20600800/js-client-side-exif-orientation-rotate-and-mirror-jpeg-images
– Daniel Omine
in google, I searched for the words "jquery image Exif auto Rotate".
– Daniel Omine
Dear @Leandro, I know it’s been a long time and you’ve probably solved it, but I recommend this: https://answall.com/a/170492/3635, are two different solutions, because you won’t always have Exif.
– Guilherme Nascimento