Some of the uploaded images/photo’s are (unwanted) rotated, when displayed on a page.
I couldn’t find the ‘reason’ for this, so i’m unaware of a way of preventing this behavior.
Didn’t find info about this here http://learn.getgrav.org/content/media
Does anyone know why this happens, and how to prevent this from happening ?
They added a “fixOrientation” function in v1.0.8, which reads the exif data of your image. So if your camera have added an orientation flag inside an image, Grav tries to correct the orientation.
Usually happens with images taken with cameras and devices that do not actually rotate the image, but save the rotation information in the EXIF image data.
The solution currently is to use
|fixOrientation in the Twig (or
?fixOrientation in the Markdown of the page (example:
I have a pending PR to automatically apply this orientation fix on all images, but that unfortunately there is a bug on the library we use for images, and until my fix for that library is applied (https://github.com/Gregwar/Image/pull/109), we cannot add a fix to Grav.
That works great.
Solves a huge problem…