nguyenhoanglam / ImagePicker

A customizable library for selecting images on the device.
Apache License 2.0
598 stars 158 forks source link

Image model does not include the path variable #149

Open mehrdadnoruzy opened 1 year ago

mehrdadnoruzy commented 1 year ago

Thank you for updating the library to kotlin version, because in the previous java version it took 30 seconds to load images in the ImagePickerActivity :-)

I have a problem with Image model. It does not include the "path" variable ( "image.path" does not exist ), In the previous java version, this was available in the class, but unfortunately it has been removed in the new kotlin version

I need something like this : https://github.com/esafirm/android-image-picker/blob/2.x/imagepicker/src/main/java/com/esafirm/imagepicker/model/Image.kt

I need this format : /storage/emulated/0/Download/example.jpg

But I got this format from " image.uri.path " : /external_primary/images/media/118595

And I got into trouble because of this. :-(

Is it possible to update the library?

Thanks

Nukano commented 1 year ago

I am in the same case as you. I needed the previous PATH format to create the Bitmap because I was getting FileNotFound error but with this code I solve it.

val inputStream: InputStream? = applicationContext.contentResolver.openInputStream(image.uri) val bm :Bitmap = BitmapFactory.decodeStream(inputStream)