-
Notifications
You must be signed in to change notification settings - Fork 673
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Does Coil support imageByteArray? #171
Comments
It's not part of the base library, but it could be added pretty easily with a custom class ByteArrayFetcher : Fetcher<ByteArray> {
override fun key(data: ByteArray): String? = null
override suspend fun fetch(
pool: BitmapPool,
data: ByteArray,
size: Size,
options: Options
): FetchResult {
return SourceResult(
source = ByteArrayInputStream(data).source().buffer(),
mimeType = null,
dataSource = DataSource.MEMORY
)
}
} You can then add it to your Once that's done you can call |
Wow. It worked perfectly. Thank you. |
For all finding this issue in 2022: |
When I'm trying to pass imageByteArray as a parameter into the load function it's throwing some error such as 'None of the following functions can be called with the argument supplied'. But it's working perfectly using Glide. Sharing my code snippet of what I have done using Coil and Glide.
Using Coil
Using Glide
Did anyone face the same issue?
The text was updated successfully, but these errors were encountered: