Some portrait images turn to landscape when preview is made

Hi. I uploaded a portrait image in a region, and when I saved it and returned to layout page, saw that it turned to landscape.
why is that? can anyone help me?
this is the image:

Have you looked at our guide that goes through the steps on how to change the screen orientation for Players: How to change the screen orientation for your Xibo Players ?

It is not screen orientation issue. Just xibo decides that this portrait image been saved as landscape (I even checked in server library) and so been showed as landscape in previews and in clients. Other medias are all ok and everything else is working

I’ve tried the image you provided and that works as expected, although I suspect uploading it to Community may have made changes to it.
image

Xibo does not do any processing on the image and will show the image as it is saved. Some cameras and phone camera apps will store portrait images as landscape, with an EXIF metadata flag saying that it should be displayed rotated. Those kinds of images will show as landscape in the CMS since that is how the image is actually saved in the file.

In that case, you’d need to open the image, rotate it, and save it before uploading in to Xibo for it to show up as portrait.

This of course may not be the original image that you used, and it may have been processed in the upload to the community, so please do pass on the original if you would like us to take a further look.

Thanks.
I’ve tried to zip and send it, but is not allowed here. how else could I pass the original one?

You can upload to here: https://transfer.xibo.org.uk/ and paste the link here or to me direct, whichever you prefer.

Thank you
That’s it:
https://transfer.xibo.org.uk/b1071ce2a55f

Thank you for providing the image file.

Looking at the image details, the image would need to be rotated before uploading to the Xibo CMS as it shows the following dimensions for a landscape image:

image

The rotated file can be found at the following link: https://transfer.xibo.org.uk/e30fe70cd52f which if you look at the image details will now show the following dimensions to display as a portrait image:

image
There are tools available that will take a directory full of images and automatically rotate them based on EXIF

On Linux, you can use exiftran: exiftran -a -i *.jpg

Windows has https://savolai.net/software/jpeg-autorotate/ which is untested by us, but gives you an example of what is available to handle batch rotations.

irfanview batch function may do that too:

I hope that is helpful to you.

Thanks.
Actually I find something else. in getResource function of widget/Image.php, I changed
$img = Img::make($filePath);
to
$img = Img::make($filePath)->orientate();
and that automatically fix the issue. Rotate if needed, otherwise the original file.
What is your opinion?

We can certainly record it as a Feature Request, but generally speaking user feedback is that we shouldn’t do any processing on uploaded items.

1 Like
The Xibo Community site uses cookies. What are cookies?