简体   繁体   English

三星前置摄像头问题

[英]Samsung front camera issue

I'm using Intent(MediaStore.ACTION_IMAGE_CAPTURE) to get a photo from the camera, it works fine on all devices, except for samsung devices where if you take photo with the frontal camera it appears rotated 180 degrees. 我正在使用Intent(MediaStore.ACTION_IMAGE_CAPTURE)从相机获取照片,它在所有设备上都可以正常工作,但三星设备除外,在三星设备中,如果您使用前置相机拍摄照片,它会旋转180度。

I can rotate the image 180 degrees to correct the issue with the frontal camera, but this causes the rear camera photos to be rotated as well. 我可以将图像旋转180度以解决前置摄像头的问题,但这也会导致后置摄像头照片也旋转。

Is there any way I can detect which camera is taking the picture, and therefore only rotate the frontal camera's images? 有什么方法可以检测到哪个相机在拍摄照片,因此只能旋转前置相机的图像?

it works fine on all devices 在所有设备上都可以正常工作

No offense, but I rather doubt that. 没有冒犯,但我对此表示怀疑。 There are a lot of buggy camera apps. 很多越野车相机应用程序。 Bear in mind that some of those buggy camera apps are user-installed, not just pre-installed. 请记住,其中一些错误的相机应用程序是用户安装的,而不仅仅是预先安装的。

Is there any way I can detect which camera is taking the picture 有什么办法可以检测到哪个相机在拍照

Not really. 并不是的。 I do not see an EXIF tag for that, and there is no requirement that the camera app put the tag in the image anyway. 我没有看到EXIF标签 ,也没有要求Camera应用将标签放入图像中。 You are not told any details about the picture other than the picture itself. 除了图片本身之外,没有告诉您有关图片的任何详细信息。 You could try playing some games, looking at the image resolution and comparing it with possible camera resolutions, but that will be unreliable. 您可以尝试玩一些游戏,查看图像分辨率并将其与可能的相机分辨率进行比较,但这将是不可靠的。

In general, with ACTION_IMAGE_CAPTURE , you just wind up living with spotty results. 通常,使用ACTION_IMAGE_CAPTURE可以使您的生活ACTION_IMAGE_CAPTURE Your primary alternative is to use a library to embed photo capture into your app (eg, CameraKit-Android, Fotoapparat), trading off the unreliability of third-party camera apps with the unreliability of device manufacturer camera API support. 您的主要替代方法是使用库将照片捕获嵌入到您的应用程序(例如CameraKit-Android,Fotoapparat)中,以权衡第三方相机应用程序的不可靠性和设备制造商相机API支持的不可靠性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM