Page 1 of 1

IMAGE_MEDIA converts portrait images to landscape

PostPosted: Tue May 05, 2020 6:41 pm
by pbdavis
When uploading images that are portrait, Servoy converts them to landscape with the image rotated counterclockwise 90 degrees. Anyone know why this is happening and how to stop it from happening?
I'm using the field element with displayType of IMAGE_MEDIA. I'm using the built-in control to upload the image in a web client.

Re: IMAGE_MEDIA converts portrait images to landscape

PostPosted: Wed May 06, 2020 11:52 am
by Andrei Costescu
If you compare the bits in original image and server uploaded image are they not the same? I would expect them to be the same.
I know images can have a rotation flag in their properties that not all image viewing software uses/applies. Make sure you look at the two images using the same photo viewer.

Re: IMAGE_MEDIA converts portrait images to landscape

PostPosted: Wed May 06, 2020 10:45 pm
by pbdavis
They are the same.
The image is shown in portrait on all applications I tried on a Mac and PC. Servoy is the only one that rotates the image. I do see that the orientation flag is set to: Orientation 6 (Rotated 90 degrees CCW). Which is what I see in Servoy. But, somehow the other application know the image was taken in portrait and they show it in portrait.
I will just add a feature to rotate the image right if the user wants to view/save it in portrait.
Thanks.

Re: IMAGE_MEDIA converts portrait images to landscape

PostPosted: Thu May 07, 2020 8:33 am
by Richard1521662995
Hi,

Have experienced the same thing. Rotated the photo by 90degrees but it made no difference. Believe that you can use the images plugin to rotate and resize, don't have experience of that as yet.

Richard

Re: IMAGE_MEDIA converts portrait images to landscape

PostPosted: Fri May 08, 2020 9:40 am
by Andrei Costescu
Ah ok. So the bits are not altered. That is fine then.

I think that the image data is landscape but it has the rotation information - and all the apps you tried look at that rotation information and apply it/show it portrait.
And (didn't check but I suspect) the IMAGE_MEDIA field might ignore that rotation flag. If you want/need better support for rotating info in image media fields you can file a case.

P.S. Indeed the image plugin does offer a way to read metadata from .jpg files (I guess that is what you have) and rotate them... but you need to do that in scripting then yourself.