-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Photo broken on Android 7.0 #37
Comments
Hi @RGBvision we facing the same issue specifically on Xiaomi Redmi Note 9S and we don't know how to fix it, we do not have a such device that we can reproduce this bug, you can help us? |
How can I help? IMHO problem in image format. I faced this kind of problem before. The problem was solved by setting the correct format (YUV_420_888). But this is only a guess. |
Hi @RGBvision. For more fun Image.toBitmap(): Bitmap {
val yBuffer = planes[0].buffer // Y
val uBuffer = planes[1].buffer // U
val vBuffer = planes[2].buffer // V
val ySize = yBuffer.remaining()
val uSize = uBuffer.remaining()
val vSize = vBuffer.remaining()
val nv21 = ByteArray(ySize + uSize + vSize)
// U and V are swapped
yBuffer.get(nv21, 0, ySize)
vBuffer.get(nv21, ySize, vSize)
uBuffer.get(nv21, ySize + vSize, uSize)
val yuvImage = YuvImage(nv21, ImageFormat.NV21, this.width, this.height, null)
val out = ByteArrayOutputStream()
yuvImage.compressToJpeg(Rect(0, 0, yuvImage.width, yuvImage.height), 50, out)
val imageBytes = out.toByteArray()
return BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.size)
} If we are doing something wrong, please, tell us. |
Hi @RGBvision @luiguild @TeruyaHaroldo I have the same behavior when I run the android-yoonit-camera demo app in Xiaomi Poco X3 so I'm going look into this problem to bring us a solution |
Hi @RGBvision we just released a new feature allowing change the color encoding of the saved image in the android-yoonit-camera repo and this should resolve the bug. For tomorrow I will update the nativescript-yoonit-camera as well https://github.com/Yoonit-Labs/android-yoonit-camera/releases/tag/2.4.0 |
Problem not resolved. Photo still broken. There is no setImageCaptureColorEncoding function. |
Hello @RGBvision Sorry for the delay. Test the There is no need to call any function. We changed internally the default "color encoding algorithm". |
@RGBvision you could test this new version? Your photos are ok now? |
If the demo apps cannot help and there is no issue for your problem, tell us about it
Photo looks like this
![Screenshot_20210103-121915](https://user-images.githubusercontent.com/7871995/103475555-12891c80-4dbf-11eb-8053-6cfdbe61eec4.jpg)
Which platform(s) does your issue occur on?
Please, provide the following version numbers that your issue occurs with:
Please, tell us how to recreate the issue in as much detail as possible.
The text was updated successfully, but these errors were encountered: