Giter Club home page Giter Club logo

flash-animated-gif-library's Introduction

This is a library that I had to write in order to facilitate animated avatars and room objects in Worlize. Haven't gotten around to writing any documentation. For a usage example, take a look at GifTest/src/GifTest.mxml and if you would like me to spend some time writing up documentation, vote for it by sending me a message! ;-)

In my tests it is two orders of magnitude faster than Thibault Imbert's AS3 Gif Player Class, and it manages to correctly render every valid GIF file I could find. Its parser is quite strict, however, so if you have a GIF that works in the browser but not with this library it probably means your browser is being overly lenient with the corrupt image data.

The speed gains are achieved by specifically avoiding doing any pixel decoding at all and instead splitting and re-packaging each frame of the animation into its own freestanding gif file, handing the resulting single-frame GIF files to Flash to decode the frame's image data internally via the Loader class.

Try the test app: Try the test app

Check out Worlize and try uploading an animated GIF as your avatar! :)

This library is made available under the Apache License, Version 2.0

flash-animated-gif-library's People

Contributors

taberrr avatar theturtle32 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flash-animated-gif-library's Issues

License?

Hi,

Your project looks very interesting, but doesn't not seem to declare a license of any sorts, so I do not know whether I am allowed to use your code. Could you add a license? (e.g. MIT Licensed would be wonderful :P)

Thanks :)

Dynamically Change Framerate of GIF?

I've been trying to create a working function that changes the framerate of an animated GIF after initialization since I need it for a project, but I can't seem to figure out anything that works. Is there a chance you could add or tell me how to add such a function? Thanks.

Edit: I figured out a way around the problem by making the step function public and using a timer, but if you still wanted to add this I'm sure there's some people who would appreciate it.

Not playing if add to stage after decode complete

It's actually a bug which can be triggered like this:

    var gif:GIFPlayer = new GIFPlayer();
    gif.addEventListener(GIFPlayerEvent.COMPLETE, function (e:*):void {
        addChild(gif);
    };
    gif.loadBytes(gifDataBytes);

As I tried, two lines' modification should fix this:

  1. remove the stage check inside function handleDecodeComplete (GIFPlayer.as) :
  - if (stage) {
       if (autoPlayer) {
       ...
  - }
  1. add a stage check inside function goto (GIFPlayer.as) :
  + if (stage == null) return;

     _cuirrentFrame = requestedIndex;
     ...

And another problem is that the function goto need to change it's name into something like gotoFrame or it will cause error when compiling in lots of flashplayer compile targets.

This is a great project which really properly handled gif files, and is better than the version you can find on the internet written by "bytearray"(?).Thanks and I'm using this lib in a business project.

SWF File

Hey!

Friend of mine, used this before in order to replace a background on a 800x600 SWF Window made in AS3. I wanted to do the same so I could have a living background for my game, but how do I make a addchild for it, and where and how can i use URLRequest?

-Thanks :p

Support for static gifs

It would be great if static gifs were also supported.

In particular, this one fails to work:
2ba075d9f5de4d84743be13c72aaa021

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.