getRemoteBitmap

private fun getRemoteBitmap(uri: Uri, destinationWidth: Int, destinationHeight: Int): BitmapAndHeaders

Downloads a remote image and returns a bitmap of the image. If provided the bounds of the destination view, the bitmap will be sampled to fit, avoiding OOM exceptions on large images.

Return

the bitmap of the image

Parameters

uri

the uri of the remote image.

destinationWidth

the width of the view that will display this bitmap. If 0, the bitmap will be unsampled.

destinationHeight

the height of the view that will display this bitmap. If 0, the bitmap will be unsampled.