displaying gif images using skia

1,517 views
Skip to first unread message

swagat mishra

unread,
Aug 11, 2012, 6:10:11 PM8/11/12
to skia-d...@googlegroups.com
hi,
i am trying to display a gif animation on android using skia.
i passed the image.gif file to SkImageDecoder::DecodeFile and got back the first frame as a bitmap.
Is there some way to get all the frames, so that i can display the animation?

Mike Reed

unread,
Aug 13, 2012, 8:53:48 AM8/13/12
to skia-d...@googlegroups.com
Skia's imagedecoders do not handle animated-gif yet. The codecs in
webkit do, if you want to try to harvest code from there...
> --
> You received this message because you are subscribed to the Google Groups
> "skia-discuss" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/skia-discuss/-/zc3S_lE-gyIJ.
> To post to this group, send email to skia-d...@googlegroups.com.
> To unsubscribe from this group, send email to
> skia-discuss...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/skia-discuss?hl=en.

swagat mishra

unread,
Aug 13, 2012, 2:36:24 PM8/13/12
to skia-d...@googlegroups.com
thanks for the response...
does it handle extracting all frames from a gif?? i can proceed with animation , if i have all the frames as bitmaps

Mike Reed

unread,
Aug 13, 2012, 2:37:21 PM8/13/12
to skia-d...@googlegroups.com
Decoding images is not a skia feature per-se. The Skia library has a
set of wrappers around std decoders (e.g. around libjpeg) that make it
easy to package up the results in an SkBitmap. The wrappers we've
written so far do not support selecting different frames within an
animated gif file, but they could be extended by someone, or rewritten
to do so. At this time it is not a priority for the core skia team,
given the existence of just such a wrapper in chrome/webkit.
> --
> You received this message because you are subscribed to the Google Groups
> "skia-discuss" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/skia-discuss/-/EZWIP-Q6l9IJ.

swagat mishra

unread,
Aug 14, 2012, 5:29:41 PM8/14/12
to skia-d...@googlegroups.com
hi,
i would like to know where in chrome webkit, a gif wrapper is present , so that i can take a look and extend skia to handle frames.
can you let me know of the specific place i am supposed to look?
 

Mike Reed

unread,
Aug 15, 2012, 8:48:58 AM8/15/12
to skia-d...@googlegroups.com
WebKit/Source/WebCore/platform/image-decoders/
> --
> You received this message because you are subscribed to the Google Groups
> "skia-discuss" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/skia-discuss/-/u1M0ebpGwtgJ.

om

unread,
Sep 5, 2012, 9:01:51 PM9/5/12
to skia-discuss
You can possibly use SkMovie (SkGIFMovie) class in images
\SkMoview.h...

You can find a java example in android-lab APIDemos -
BitmapDecode.java
Or simply use:
SkMovie::setTime(time);
followed by
SkMovie::bitmap();
to get appropriate animation bitmap..
Reply all
Reply to author
Forward
0 new messages