fresco icon indicating copy to clipboard operation
fresco copied to clipboard

Animations with PNG sequences

Open haseebrabbani opened this issue 11 years ago • 9 comments

Hi, I am trying to determine the viability of Fresco for the animations in my app. I have PNG sequences for each animation which are included as drawable resources in my project (one PNG per frame named as frame_1.png, frame_2.png, etc...). My question is: how can I get Fresco to animate these frames for me in a SimpleDraweeView? Does it currently support this functionality?

haseebrabbani avatar Jul 15 '15 16:07 haseebrabbani

Is transforming sequence of pngs into single animated webp image an option here ? Note that you would probably save a lot of bytes this way. There is no support for assembing animations from multiple frames right now.

michalgr avatar Jul 15 '15 17:07 michalgr

Is there a recommended tool for converting PNG sequences into animated WebP files?

haseebrabbani avatar Jul 15 '15 17:07 haseebrabbani

The only tool that comes to mind is ImageMagick. You'll have to convert the frames to an animation (gif or webp) before sending it to your app. I don't know if it's possible to use ImageMagick to convert the png frames to an animation in android

AcidicSkittles avatar Jul 16 '15 05:07 AcidicSkittles

So I've got the GIF animation. How can I tell Fresco to only play it once? I see the anim.start()/stop() methods, but is there a way to tell Fresco to just play an animation once and then stop?

haseebrabbani avatar Jul 16 '15 08:07 haseebrabbani

I don't think there's an api call in frasco for that. If you're using ImageMagick to build the gif, I do know that it has a -loop flag. You can try that to set it to play only once using -loop 1

AcidicSkittles avatar Jul 17 '15 03:07 AcidicSkittles

It seems like GifImage#getLoopCount is never used to limit the loop times...

solohsu avatar Aug 07 '15 08:08 solohsu

The loop count specified in the GIF image should be respected. If that's not the case then it is a bug.

plamenko avatar Aug 07 '15 15:08 plamenko

The bug is tracked separately in #180

tyronen avatar Sep 25 '15 15:09 tyronen

Cleaning up old issues

erikandre avatar Jun 09 '17 13:06 erikandre