Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFImageLoading is not supporting the GZIP encoded format. #533

Closed
espritm opened this issue Mar 9, 2017 · 4 comments
Closed

FFImageLoading is not supporting the GZIP encoded format. #533

espritm opened this issue Mar 9, 2017 · 4 comments

Comments

@espritm
Copy link

espritm commented Mar 9, 2017

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 ?

@patook
Copy link

patook commented Mar 9, 2017

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.

@espritm
Copy link
Author

espritm commented Mar 10, 2017

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

@espritm
Copy link
Author

espritm commented Mar 10, 2017

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

@espritm espritm changed the title Some png URLs does not show image, some other show image FFImageLoading is not supporting the GZIP encoded format. Mar 10, 2017
@daniel-luberda
Copy link
Member

daniel-luberda commented Apr 4, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants