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'm trying to use Akavache with Splat for image caching in a Xam Forms project. When unit testing, I kept getting the following error any time I access the cache:
Unexpected token while deserializing object: PropertyName. Path 'Value.Width'.
I created a simple console app that experiences the same problem when using the GetImage method or gets an invalid image exception when using GetImage2. The image is a just a sample I pulled from Google images, but is a valid image. The example App can be found in my Git repo
The text was updated successfully, but these errors were encountered:
in the first test method, serializing IBitmap won't serialize the image bytes correctly. I'd recommend against doing that - you can see in the sample how to serialize the bytes directly (like Akavache does under the hood).
in the second test, I believe Akavache was using the cached (invalid) bytes from the first test method (because the URL is used as the key unless you specify it explicitly) and it was unable to transform these bytes into a valid image format.
In general, I'd recommend using the LoadImageFromUrl helper methods, as this will take care of the boring grunt work.
I'm trying to use Akavache with Splat for image caching in a Xam Forms project. When unit testing, I kept getting the following error any time I access the cache:
Unexpected token while deserializing object: PropertyName. Path 'Value.Width'.
I created a simple console app that experiences the same problem when using the GetImage method or gets an invalid image exception when using GetImage2. The image is a just a sample I pulled from Google images, but is a valid image. The example App can be found in my Git repo
The text was updated successfully, but these errors were encountered: