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

Very long time before play GIF begins #358

Closed
TomasValenta opened this issue Mar 2, 2015 · 5 comments
Closed

Very long time before play GIF begins #358

TomasValenta opened this issue Mar 2, 2015 · 5 comments
Labels
Milestone

Comments

@TomasValenta
Copy link

Glide Version: 3.5.2
Device/Android Version: LG G3 / CyanogenMod 12 5.0.1 (in emulator 4.2.2 is the same situation)
Issue details/Repro steps: Hello, I tried some GIFs like this:
http://media.giphy.com/media/ztYZgHh8YhPy0/giphy.gif
http://media.giphy.com/media/7MZ0v9KynmiSA/giphy.gif
http://asker.graph.no/webcam/animate.gif

Playback works, but after a very long time waiting (about 3-5 minutes). No errors in logcat. Any idea?

Glide load line:

Glide.with(mContext)
        .load(url)
        .centerCrop()
        .crossFade()
        .signature(mStringSignature)
        .into(new GlideDrawableImageViewTarget(ViewHolder.vImage) {
            @Override
            public void onResourceReady(GlideDrawable drawable, GlideAnimation anim) {
                super.onResourceReady(drawable, anim);
                ViewHolder.vProgress.setVisibility(View.GONE);
            }
        });

Stack trace:

Nothing, only very long time waiting...
@TWiStErRob
Copy link
Collaborator

Well, the last one took me 2 minutes to load in Chrome, my phone went to sleep. Maybe the files (actually one of them) are too big to fit in cache, so it is always downloaded.

@TomasValenta
Copy link
Author

Ok,
but the first file have only 936 kB and the waiting time do not correspond to the downloading time. When I am watching network status on phone, the data transmit finished in about 20s, but playback start so much later. I tried the same with Ion (https://github.com/koush/ion) and its playback start in the same time when downloading finished ;)

@TWiStErRob
Copy link
Collaborator

Ah yes, take a look at #281 (it looks like a dupe at quick glance), Sam says there, for GIFs use:

.diskCacheStrategy(DiskCacheStrategy.SOURCE)

I guess the time between the download finish and the displaying is the RESULT caching: the encoder writes the resized frames into a new GIF.

@sjudd
Copy link
Collaborator

sjudd commented Mar 2, 2015

Robert's correct. It's an unfortunate default in Glide 3.0 and it gets
worse the larger your GIF is. We're fixing (really have fixed) this in
Glide 4.0, but until then if you're retrieving remote GIFs you want to use
DiskCacheStrategy.SOURCE and if you're retrieving local GIFs you want to
use DiskCacheStrategy.NONE.

@sjudd sjudd added the bug label Mar 3, 2015
@sjudd sjudd added this to the 4.0 milestone Mar 3, 2015
@TomasValenta
Copy link
Author

Thank you both very much. Now it's working perfectly!

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

No branches or pull requests

3 participants