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 store my images to file manager manually then use kingfisher's LocalFileImageDataProvider to load it onto ui image view. It was working perfectly for a few days until it wasn't. Currently, setting image using LocalFileImageDataProvider, image is nil, while image file still exist.
I was wondering if there is a certain duration that LocalFileImageDataProvider works or?
I don't think there is a "certain duration that LocalFileImageDataProvider works"...Regardless of a local data provider or a remote URL data fetching, both are working in similar ways: Check the cache, if not hit, then get the data from the origin place (the local file or URL) and cache the image.
From your description, it seems that once the cache is expired, it stops loading from the original local file. It should not happen.
I also tried to build a simple sample with LocalFileImageDataProvider and a very short disk cache expiration duration (to simulate your case), but I cannot reproduce it at all.
Can you try:
Make sure that the url you use in fetchStoredImage has exactly the same path as you get in isImageSaved.
Try to print some result to see if there is an error and/or where the image is from when you set it.
self.imageView.kf.setImage(with: provider, options:self.options){ result in
switch result {case.success(let r):print(r.cacheType)print(r.source)case.failure(let error):print(error)}}
By the way, you can use the .diskCacheExpiration option change the disk cache duration to a smaller value to boost the verification.
Hi
I store my images to file manager manually then use kingfisher's LocalFileImageDataProvider to load it onto ui image view. It was working perfectly for a few days until it wasn't. Currently, setting image using LocalFileImageDataProvider, image is nil, while image file still exist.
I was wondering if there is a certain duration that LocalFileImageDataProvider works or?
Below is my code:
Below function returns true, image still exist.
The text was updated successfully, but these errors were encountered: