Why do image byte data in onPictureTaken lead to mirroring?

I call takePicturewith 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");
}

When testing, I found that the image is always mirrored about the y axis. Does anyone know (1) if this is happening for all devices, and (2) why? I really don't understand why the byte data does not represent what I see in the camera preview. Is this an unreasonable temptation?

+5
source share
1 answer

I think you are using Front Camera correctly? This is the behavior of Front Camera. Even if you use a webcam on your laptop, it’s the same.

. ,

+4

All Articles