memory-friendly resize for circle cropping

Fixes #2224
// FREEBIE
This commit is contained in:
Jake McGinty
2014-12-15 19:48:20 -08:00
parent 199c28dad6
commit ec18da8aa9
2 changed files with 8 additions and 6 deletions

View File

@@ -202,10 +202,11 @@ public class BitmapUtil {
return getScaledCircleCroppedBitmap(bitmap, srcSize);
}
public static Bitmap getScaledCircleCroppedBitmap(Context context, Uri uri, int destSize) throws FileNotFoundException {
InputStream dataStream = context.getContentResolver().openInputStream(uri);
InputStream orientationStream = context.getContentResolver().openInputStream(uri);
Bitmap bitmap = BitmapFactory.decodeStream(dataStream);
public static Bitmap getScaledCircleCroppedBitmap(Context context, MasterSecret masterSecret, Uri uri, int destSize)
throws FileNotFoundException, BitmapDecodingException
{
InputStream orientationStream = PartAuthority.getPartStream(context, masterSecret, uri);
Bitmap bitmap = createScaledBitmap(context, masterSecret, uri, destSize, destSize);
return getScaledCircleCroppedBitmap(fixOrientation(bitmap, orientationStream), destSize);
}