IMAGE_MEDIA converts portrait images to landscape

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

IMAGE_MEDIA converts portrait images to landscape

Postby pbdavis » Tue May 05, 2020 6:41 pm

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.
Paul Davis
Belcan Engineering Group, LLC
pbdavis
 
Posts: 60
Joined: Thu Nov 30, 2017 5:40 pm
Location: Florida, USA

Re: IMAGE_MEDIA converts portrait images to landscape

Postby Andrei Costescu » Wed May 06, 2020 11:52 am

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.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: IMAGE_MEDIA converts portrait images to landscape

Postby pbdavis » Wed May 06, 2020 10:45 pm

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.
Paul Davis
Belcan Engineering Group, LLC
pbdavis
 
Posts: 60
Joined: Thu Nov 30, 2017 5:40 pm
Location: Florida, USA

Re: IMAGE_MEDIA converts portrait images to landscape

Postby Richard1521662995 » Thu May 07, 2020 8:33 am

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
Richard Clarke
acss.co.uk
Richard1521662995
 
Posts: 39
Joined: Wed Mar 21, 2018 10:09 pm

Re: IMAGE_MEDIA converts portrait images to landscape

Postby Andrei Costescu » Fri May 08, 2020 9:40 am

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.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 12 guests

cron