ASD Solutions
ASD Solutions

Reputation: 189

Codenameone Capture Photo Upside down

using the Capture class to take photos using the front facing camera (Selfie Camera) on android, the photo comes out upside down. Is there any way we can detect that the front facing camera was used so we can rotate the image if needed?

Upvotes: 1

Views: 71

Answers (1)

Shai Almog
Shai Almog

Reputation: 52760

Some cameras capture the image in the orientation of the camera sensor then mark it with a special rotation flag in EXIF to indicate that the image should be viewed in a different orientation. This is common in the back camera that always captures in landscape and marks portrait images as rotated.

When you open an image using Image.createImage(filePathToImage) we implicitly detect EXIF data and adjust the image so it will be viewed correctly. Other image loading methods don't work the same way. This highly depends on the Image API you used and the Capture call you made as there are few variations of both.

Upvotes: 1

Related Questions