Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reduce the size of camera picture while saving, using the camera action intent?

How to reduce the size of camera picture while saving, using the camera action intent.

I was trying to use MediaStore.EXTRA_SIZE_LIMIT in putExtra of the camera action as below :

Intent captureintent =  new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);  
captureintent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
captureintent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0);
captureintent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION, 0);
captureintent.putExtra(MediaStore.EXTRA_SIZE_LIMIT, The Value to be Kept);

But this doesn't seem to work.

What is the efficient way to do so?

like image 386
Shail Adi Avatar asked Jan 03 '13 15:01

Shail Adi


1 Answers

This is not possible on Android. ACTION_IMAGE_CAPTURE can only be used with MediaStore.EXTRA_OUTPUT, not the other three extras.

See http://developer.android.com/reference/android/provider/MediaStore.html.

like image 93
Adam Nybäck Avatar answered Oct 28 '22 19:10

Adam Nybäck