Open mjfara opened 10 years ago
Hmmmm, that's bad. I think, that problem is in HttpWebRequestDownloader.cs
, I'll be happy if you can check it's sources https://github.com/artem-zinnatullin/jet-image-loader/blob/master/JetImageLoader/Network/HttpWebRequestDownloader.cs or you can try to write your own downloader — simply implement IDownloader
and then use it in JetImageLoaderConfig
Thank you for your response. I added your package through nuget. Do I have to do it differently in order to modify the source code? I am unfamiliar with how this all works.
No problem, just write your own implementation of IDownloader
and pass it to the JetImageLoader
from GetJetImageLoaderConfig
, I recommend to firstly copy HttpWebRequestDownloader
code and debug what's happening on bad internet connection
Ah got it, will do, thanks! If I get a fix I will post it here.
Thank you :)
Unfortunately this is difficult to diagnose as it happens when connection is dropped in the middle of a download. I was thinking of just putting a button in settings that will "Clear Cache". How can I do this?
I got an idea: I created a new property ContentLength in DownloadResult.cs . When creating a new DownloadResult in HttpWebRequestDownloader, I assign the response header "ContentLenght" to the new property created. In JetImageLoader we check if the resultstream content length is different from the contentlength header...
if (downloadResult.Exception != null || downloadResult.ResultStream == null || downloadResult.ResultStream.Length != downloadResult.ContentLength) { Log("[error] failed to download: " + imageUrl); return null; }
I just wrote this solution so Im going to debug it properly.
Sometimes when there is limited connectivity, an image will not finish downloading and it will cache as an incomplete image. Most of the time it will show half of the image, and the rest of the image will be gray. How can I fix this issue?