Skip to content

Commit 048d2ae

Browse files
committed
Fix not getting image size correctly
1 parent 803e3ac commit 048d2ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

imagepicker/src/main/kotlin/com/github/drjacky/imagepicker/provider/CompressionProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ class CompressionProvider(activity: ImagePickerActivity) : BaseProvider(activity
111111

112112
/**
113113
*
114-
* @param file File to get Image Size
114+
* @param uri File to get Image Size
115115
* @return Int Array, Index 0 has width and Index 1 has height
116116
*/
117117
private fun getImageSize(uri: Uri): IntArray {
118118
val options = BitmapFactory.Options()
119119
options.inJustDecodeBounds = true
120120
// BitmapFactory.decodeFile(uri.path, options)
121-
BitmapFactory.decodeStream(contentResolver.openInputStream(uri))
121+
BitmapFactory.decodeStream(contentResolver.openInputStream(uri), null, options)
122122
return intArrayOf(options.outWidth, options.outHeight)
123123
}
124124
}

0 commit comments

Comments
 (0)