Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a thumbnail from a photo taken from camera?

In my app I'm using external camera app to make photo and save it to sdcard, and I need a square thumbnail of this photo. I've managed to crop to square the thumbnail sent back by camera in the intent, but since i'm saving photo to disk, the intent is empty, and my old method to make picture square Bitmap cropped = Bitmap.createBitmap(source, 0, 0, min, min) throws an OutOutMemory exception.

like image 455
Vadym Kovalenko Avatar asked Jul 19 '13 11:07

Vadym Kovalenko


1 Answers

Bitmap ThumbImage = ThumbnailUtils.extractThumbnail(BitmapFactory.decodeFile(imagePath), THUMBSIZE, THUMBSIZE);
like image 144
KOTIOS Avatar answered Oct 12 '22 10:10

KOTIOS