FFImageLoading is not supporting the GZIP encoded format.
Hi everyone,
I try to use FFImageLoading for my Xamarin.Android application. Everything works fine with URLs took from the Sample project on this Github. But when I use personnal URLs pictures, nothing is showing :-(
Here is the code I use :
//This one works fine
string sURL = @"https://lh4.googleusercontent.com/-Lfgi-xEMwuk/VNWoy8EDWcI/AAAAAAAAACk/rwsluNfhSZY/w1486-h832-no/photo.jpg";
//This one does not work
string sURL = @"http://api.moovenow.com/v1/fr_fr/images_public/user/140.png";
ImageService.Instance.LoadUrl(sURL)
.Retry(3, 1000)
.Error(ero =>
{
;
})
.Success(() =>
{
;
})
.Into(imageView);
When I debug, it goes throug Success method each time. But whith the URL "140.png", the imageview has no image. It's like the image was transparent.
Any idea please ?
Not sure what's happening in your case but I've run into a similar issue twice in the past. Here were my fixes:
1- http vs https. There were some changes needed to allow http queries on iOS (not sure about Android).
2- I don't know what moovenow is but some hosts disallow queries from APIs so you may need to specify a user-agent.
Hi Patook,
Thank you for your post. I tried with HTTPS, but unfortunately the result is the same. For the user-agent, I asked to the moovenow's API developers, they told me that no user-agent are required.
I noticed this line in my Debug logs. Do you think it can be the source of my problem ?
--- SkImageDecoder::Factory returned null
Ok we found the problem.
When the API return a gzip encoded png, FFImageLoading is not working.
And when the gzip is deactivated, FFImageLoading is workign fine, for the same URL.
I'll edit the title of my post to be clear
This could be easily fixed by providing custom HttpClientHandler via FFImageLoading config: http://stackoverflow.com/a/27327208/5064986
... but as IMO we should support compression out of the box, I enabled it by default.