Get the image file from a preloaded image
See original GitHub issueIs your feature request related to a problem? Please describe. I’m looking for a way to get the image file from a preloaded image, but seems Coil lacks this feature at the moment.
Describe the solution you’d like On Glide I do:
val preloadedImageFile = Glide
.with(context)
.downloadOnly()
.load(imageUrl)
.submit()
.get()
Would be nice if we have at least one of these options in Coil:
Coil.getFile(imageUrl)
Coil.load(context, imageUrl) {
target(object : FileTarget {
override fun onSuccess(result: File) {
}
})
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Preloading responsive images - web.dev
Preloading dynamically-injected responsive images # · Open this example website in a new tab. · Press `Control+Shift+J` (or `Command+Option+J` on ...
Read more >Preloading images with JavaScript - Stack Overflow
v1: Preload by passing images as arguments to preloadImages() ... Returns array of Image typed objects returned by function. Useful to check ...
Read more >3 Ways to Preload Images with CSS, JavaScript, or Ajax
Three easy ways to preload images using either CSS, JavaScript, or Ajax - an excellent way to speed things up and boost site...
Read more >How to Preload an Image - JavaScript - Media College
"Preloading" loads an image file into the users' computer memory so that it can be instantly accessed when needed. This is useful, for...
Read more >A better way to preload images for web galleries
A better way to preload images for web galleries. The canonical javascript image preloader attempts to maximize the browser's ability to load resources...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve just published
2.0.0-alpha01
which makes the disk cache public. It’s experimental and subject to change, but you can get access to the image’s file like so:The new disk cache also has support for editing/removing entries. Check it out!
+1 for this. Any chances this can be re-opened? Displaying large images through coil is a bit of a pain right now because libraries like
SubsamplingScaleImageView
only take in files instead of Drawables.I tried accessing OkHttp’s cache directly, but the code is very fragile: