Codenameone Capture Photo Upside down

扶醉桌前 提交于 2019-12-08 08:21:19

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/51480978/codenameone-capture-photo-upside-down

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!