1
votes

I need a clarification. Today I bought a new Android 10 Samsung device to test apps... and all captured images are shown rotated wrongly inside the Labels. The code is very minimal: takes a photo and then shows it in a Label. It works fine on my iPhone and my old Android device, but in this new Android device the image orientation is not detected correctly by Codename One.

Is it a bug of Codename One or is it something that needs coding in the app?

In the latter case, can you give us a code to take photos in the correct orientation? Thank you.

1
Update for the readers. Now Codename One has a new API that solves this issue: codenameone.com/javadoc/com/codename1/ui/… - Francesco Galgani

1 Answers

1
votes

I think there might already be an issue on that, if not there should be. The gist of it is this... Some modern phones always take the photos in the same orientation and just mark the photo as rotated to X degrees in its tags.

This works usually since most apps know to show the photo rotated. Currently we have a workaround for that in the gallery API but that's a bad workaround. A good workaround would be to check that flag every time we load an image and rotate it dynamically. It would be inefficient but it would solve that problem once and for all.