Is there a way to load local images stored in /dat...
# compose
m
Is there a way to load local images stored in /data with Coil ? I've been using Glide so far but it is now deprecated and I'm trying to figure out an alternative.
c
It seems like coil can load local images according to docs
Copy code
// URL
imageView.load("<https://www.example.com/image.jpg>")

// Resource
imageView.load(R.drawable.image)

// File
imageView.load(File("/path/to/image.jpg"))

// And more...
m
Thanks a lot @Colton Idle, by casting my path into a File object it's working 🙂
Copy code
Image(
    painter = rememberImagePainter(File(imageUrl)),
    contentDescription = "",
)
👍 1
570 Views