When i take a picture from the camera i get an image of size 300-500 K.B (1800 X 1700 px).
But when i take a picture from my application i get an image of size 30-50 K.B (150 X 200 px).
How can i resize 150 x 200 px to something like 300 x 400 px??
because the server i am sending this image to, won’t accept images lesser than 280 x 360 px dimensions.
The code i am using now is:
Bitmap bit = (Bitmap) data.getExtras().get("data");
ByteArrayOutputStream bao = new ByteArrayOutputStream();
bit.compress(Bitmap.CompressFormat.JPEG, 100, bao);
byte[] ba = bao.toByteArray();
File imagesFolder = new File(Environment.getExternalStorageDirectory(), "My - Images");
File f = new File(imagesFolder, "test.jpg");
f.createNewFile();
FileOutputStream fo = new FileOutputStream(f);
fo.write(ba);
fo.flush();
fo.close();
i am not compressing the image, but still i get 10 times lesser image size compared to the image take using the camera from home screen.
Thank You
To get full sized camera image you should point camera to save picture in some temporary file. then only you can get a actual size image.
Then after image capture intent finished to work – just grab your picture from imageUri using following code: