Issue details / Repro steps / Use case background:
Issue details:
When a Gif animation is started, then stopped, then restarted from its first frame, the animation does not cleanly start from first frame. Instead, for a split second one can see the last shown frame from previous run.
This is visible very very frequently, although not systematically. To be sure of what you see, it helps to capture a screen recording and then moving with a time slider in it.
Basically it seems the same issue experienced here by @Elliptica1 user, but no answer found there. Checked also issue #3445 , but no help from there as well.
Repro steps:
A repro project showing the issue is downloadable here.
Press Show button to play the composed animation: intro starts from fully transparent area, then seamlessly joins with loop.
After some seconds press Hide.
Then again, press Show and you should see the intro starting from its last shown frame (the large circle, instead of fully transparent area). The loop as well might start from its last shown frame (you see a glitch between the intro and the loop, instead of a seamless joint).
You can repeat the process multiple times. The intro and loop parts have been visually marked with a dot in order to detect which is currently showing. Again, a screen recording helps. Here's an example.
Use case background:
To show (upon some event) a composed animation made by an intro GIF, played once, then followed by a looping GIF which keeps playing.
At some point (due to some event), looping animation will be stopped and hidden.
Later on, the same composed animation is started again, so first the intro plays from the beginning, then the loop plays from its beginning.
Intro animation must always start from its first frame, as well as loop animation must always start from its first frame, in order to give a visually seamless effect.
For sake of simplicity, repro project does not include fade, cross-fade and other effects that we might apply in our actual use case.
Glide load line:
Repro project here contains actual used code.
RequestManager requestManager = Glide.with(context.getApplicationContext());
loopTarget = new MyCustomTarget(loopImageView, true, null);
requestManager
.asGif()
.load(LOOP_RES_ID)
.into(loopTarget);
/*
class MyCustomTarget extends ImageViewTarget<GifDrawable>
- stops resource, to prevent autoplay
- sets either 1 or infinite loop count
- registers animation callback, if any
*/
GlideModule:
@GlideModule
public class RestartGifAppGlideModule extends AppGlideModule {
// needed for Glide library
}
Layout XML:
Repro project here contains actual used code.
Glide Version: 4.11.0
Integration libraries: None
Device/Android Version:
Issue details / Repro steps / Use case background: Issue details:
When a Gif animation is started, then stopped, then restarted from its first frame, the animation does not cleanly start from first frame. Instead, for a split second one can see the last shown frame from previous run.
This is visible very very frequently, although not systematically. To be sure of what you see, it helps to capture a screen recording and then moving with a time slider in it.
Basically it seems the same issue experienced here by @Elliptica1 user, but no answer found there. Checked also issue #3445 , but no help from there as well.
Repro steps: A repro project showing the issue is downloadable here.
You can repeat the process multiple times. The intro and loop parts have been visually marked with a dot in order to detect which is currently showing. Again, a screen recording helps. Here's an example.
Use case background:
To show (upon some event) a composed animation made by an intro GIF, played once, then followed by a looping GIF which keeps playing.
At some point (due to some event), looping animation will be stopped and hidden.
Later on, the same composed animation is started again, so first the intro plays from the beginning, then the loop plays from its beginning. Intro animation must always start from its first frame, as well as loop animation must always start from its first frame, in order to give a visually seamless effect.
For sake of simplicity, repro project does not include fade, cross-fade and other effects that we might apply in our actual use case.
Glide load line:
Repro project here contains actual used code.
GlideModule
:Layout XML: Repro project here contains actual used code.
ImageViews are added programmatically:
Stack trace / LogCat: There's no logged error involved.