Skip to content

Load GIF from URL fail #513

@AliAl-Hadidi

Description

@AliAl-Hadidi

First I want to thank you for this awesome library. It's help me to play gif in imageview, after two weeks of try and search I found that Glide better than all other libraries.
But when try load gif (its size more than 200KB) from url Glide fail to load url and appear error drawable. this is my code:

Glide.with(this)
          .load(gif_url)
          .asGif()
          .error(getResources().getDrawable(R.drawable.error))
          .into(imageview);

I try loading same url by Ion library and It work normal.
Internet is slow in my country but despite this Ion work fine and Glide not.
my questions are:

  • Is there way to increase Glide ability in loading url to be like Ion?
  • Is there any other one have like problem or all works fine with them? I don't want to publish my app and get review that gif not work.

If there is no answer to Q1 I have no way only to download gif by Ion and then showing it by Glide and this is code i write to do:

Ion.with(this)
       load(gif_url)
       .write(file)
       .setCallback(new FutureCallback<File>() {
         @Override
        public void onCompleted(Exception e, File result) {
            Glide.with(getBaseContext())
                      .load(result)
                        .asGif()
                         .diskCacheStrategy(DiskCacheStrategy.NONE )
                           .error(getResources().getDrawable(R.drawable.erorr))
                            .into(imageview);
                                }
                            });

Please tell me if you have any suggestions to fix this problem.

Thank you very much for making Gilde and I hope get answers
Sorry for my weak English

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions