Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Camera intent returns small picture

I'm using the camera intent to capture a picture. This is my code and it works great:

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); 
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);

my onActivityResult looks like this:

if (requestCode == CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE) {
    if (resultCode == RESULT_OK) {
        Bundle extras = data.getExtras();
        Bitmap photo = (Bitmap) extras.get("data");
    }
}

The problem is, that while the picture taken by the camera is 480*800 (I'm using HTC Desire), the bitmap returned is only 194*324!

Any idea why that happens and how to resolve it?

Thanks!

like image 601
shaylh Avatar asked Mar 14 '12 11:03

shaylh


2 Answers

read this answer to get the full image size How to capture an image and store it with the native Android Camera


when you use reading Bitmap from extra, you will get Thumbnail of the image

like image 104
Mohammad Ersan Avatar answered Oct 02 '22 12:10

Mohammad Ersan


I have the same problem, I found an example on the google android site: http://developer.android.com/training/camera/photobasics.html

like image 32
Levi Saturnino Avatar answered Oct 02 '22 14:10

Levi Saturnino