decodeBitmapAsync

suspend fun decodeBitmapAsync(context: Context, imageUri: Uri): Bitmap

Decode bitmap from an imageUri. Accepts URI schemes accepted by ContentResolver.openInputStream:

The decode runs on a background dispatcher, so this is safe to call from the main thread.

Return

The decoded bitmap.

Parameters

context

The context to use.

imageUri

Uri from which to read the bitmap.

Throws

When the file could not be read.