Skip to content Skip to sidebar Skip to footer

Android: Not Able To Get Original Photo Captured By Camera (able To Read Compress Photo Only)

In my application I capture photo by android camera and then I want to send it to the server. For this I use Client Socket programming. I convert the capture photo into bytearray(b

Solution 1:

You are using the Intent to capture the image using ACTION_IMAGE_CAPTURE. If you normally starts your camera using Intent then it will return image as a bitmap in onActivityResult() but it will be for thumbnail purpose.

If you want to get full resolution image from the camera then you should provide a file with the intent which you are firing to start the camera activity.

You can do like below

Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
File out = Environment.getExternalStorageDirectory();
out = new File(out, imagename);
i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(out));
startActivityForResult(i, CAMERA_RESULT);

Here there is a MediaStore.EXTRA_OUTPUT parameter which takes a Uri of the file in which you want your camera to write a images.

For more information you can refer below example

Capture full resolution image from camera

Post a Comment for "Android: Not Able To Get Original Photo Captured By Camera (able To Read Compress Photo Only)"