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
The documentation for the fade transition says that
The transition will not happen when the image is retrieved from either memory or disk cache by default
But in one particular case it seems to still being applied - when it's used with downsampling.
I noticed that my snapshot tests started to fail after I added downsampling to the KFImage I use. Upon closer look, it turned out to be that images now don't appear instantly but with a slight delay and a fade transition animation.
Here's the image setup:
Use KFImage with fade and downsampling applied along with cache being set up.
Upon retrieval images from the cache fade transition is still being applied.
Other Comment
I did try using .cacheOriginalImage but it did not make any difference.
The text was updated successfully, but these errors were encountered:
It appears to be caused in KingfisherManager.retrieveImageFromCache
looks for a cached processed image and fails
then looks for the original image and succeeds
then processes the image
stores the processed image in the cache
returns the cacheType as .none since the processed image was missing from the cache
It fails to find the processed image since kingfisher appends the processor identifier to the cache key when saving and restoring.
This is probably expected behaviour since the final image wasn't found in the cache so retrieving it could take long enough that the fade is needed.
My current workaround is to make a MockImageCache for use in the tests, which always discards the options when retrieving an image since the options are used to modify the cache key.
The one downside with this approach is it'll bypass running any processor on the image, so your snapshots wont accurately test whether the correct processor is being used.
Check List
Issue Description
What
The documentation for the
fade
transition says thatBut in one particular case it seems to still being applied - when it's used with
downsampling
.I noticed that my snapshot tests started to fail after I added
downsampling
to theKFImage
I use. Upon closer look, it turned out to be that images now don't appear instantly but with a slight delay and a fade transition animation.Here's the image setup:
And here is the cache setup:
Reproduce
Use KFImage with
fade
anddownsampling
applied along with cache being set up.Upon retrieval images from the cache
fade
transition is still being applied.Other Comment
I did try using
.cacheOriginalImage
but it did not make any difference.The text was updated successfully, but these errors were encountered: