Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does the image byte data in onPictureTaken result in a mirrored image?

Tags:

android

I call takePicture with a callback for the jpeg event: camera.takePicture(null, null, this);

Here is the callback handler:

@Override
public void onPictureTaken(final byte[] data, Camera camera) {
    Bitmap picture = BitmapFactory.decodeByteArray(data, 0, data.length);
    MediaStore.Images.Media.insertImage(getContentResolver(), picture, "name" , "description");
}

In testing, I'm finding that the image is always mirrored about the y-axis. Does anyone know (1) whether this happens on for all devices, and (2) why? I really don't understand why the byte data doesn't represent what I see in the camera preview. Is that an unreasonable expection?

like image 933
user5243421 Avatar asked Oct 05 '22 07:10

user5243421


1 Answers

I think you are using Front Camera right? That is the behavior of Front Camera. Even if you use a web cam on your laptop, it is the same.

If you want to fix it. Please refer Here

like image 103
Calvin Avatar answered Oct 13 '22 12:10

Calvin