You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this is best handled by adding a filenameFactory (or similar) param to DiskCache.Builder so it's possible to set a custom DiskCache.Key -> String function for creating the file name. That said, if you're sharing an image from Coil's file cache I'd recommend copying it locally as the file can disappear at any time.
Sorry, I was proposing a potential API as this doesn't exist yet. After thinking about this more we'd have to be careful adding this API as changing the filenameFactory's logic after files have already been added to the cache would corrupt the disk cache. I think we'd need to have migration/versioning support as well to make this safe.
colinrtwhite
changed the title
Preserve image extension in DiskCache.
Support custom disk cache file naming strategies
Nov 16, 2023
Is your feature request related to a problem? Please describe.
Thumbnail in share intent must have an image extension, otherwise it's not shown.
Code sample
When I change
snapshot.data.toFile()
to a file, which is in the same directory, but has.png
extension, everything works fine.Describe the solution you'd like
Add option in ImageLoader.Builder to preserve image extension in DiskCache.
The text was updated successfully, but these errors were encountered: