Question about captured Image with auto-rotation (problem on Android)

83 views
Skip to first unread message

Pai Peng

unread,
Jul 24, 2013, 4:12:17 AM7/24/13
to codenameone...@googlegroups.com
Hello CN1,


I have now another problem with captured Image on Android device. When I took the photos in Portrait format, the Image displayed in a Label is always in Landscape format.

By testing on iOS device, there is no such problem.


Could it be a bug in CN1?

Or how can I get the EXIF information from captured image? 


Regards,

Pai

Francis Perreault

unread,
Jul 24, 2013, 1:13:53 PM7/24/13
to codenameone...@googlegroups.com
I did see a similar issue a few weeks ago where I would display a picture in a form (can't remember if I was displaying it in a label, though), and the orientation was "locked" even if the picture was properly rotated by the OS once taken. I saw this on a Galaxy S3. It could still be there, I did not have the time to investigate this yet.

Francis

Shai Almog

unread,
Jul 24, 2013, 1:42:20 PM7/24/13
to codenameone...@googlegroups.com
This issue exists with many devices and is really a feature not a bug.
When capturing an image the device always captures them in a specific orientation and then marks them as such in the image data. So some apps that recognize that data show them in the right rotation while others don't.

On iOS we sort of broke that on purpose by seamlessly rotating the image to the "right" orientation. I'm guessing this is the simpler workaround and that we should probably add that workaround to Android too. Can you please file an issue for that?

Francis Perreault

unread,
Jul 24, 2013, 1:54:48 PM7/24/13
to codenameone...@googlegroups.com
Issue 801 filed. I'm wondering if the API could be updated to have the picture auto-rotated or not...Thanks!

Francis

Francis Perreault

unread,
Jul 26, 2013, 10:09:32 AM7/26/13
to codenameone...@googlegroups.com
Hello Pai,

Just to let you know that Shai fixed issue 801:

I just added support for this to the build server. Since this is untested its disabled by default so you will need to invoke:
Display.getInstance().setProperty("normalizeImage", "true");

when your app starts up to enable this.

Please report here if this now works like you expect, and I will do the same.

Have a nice day!

Francis
Reply all
Reply to author
Forward
0 new messages