Latest 0.1.0
Homepage https://github.com/jesseditson/uiimage-from-animated-gif
License CC0 1.0
Platforms ios 6.0, requires ARC
Frameworks UIKit, ImageIO
Authors ,

Summary

This project defines a category animatedGIF on UIImage. The category defines two methods. This method creates an animated UIImage using the frames of the GIF in data:

+[UIImage animatedImageWithAnimatedGIFData:(NSData *)data]

This method creates an animated UIImage using the frames of the GIF loaded from url:

+[UIImage animatedImageWithAnimatedGIFURL:(NSURL *)url]

Look at the comments in UIImage+animatedGIF.h for details.

You can build and run the project to see a trivial demo app.

To use this category in your own project

  1. Copy UIImage+animatedGIF.h and UIImage+animatedGIF.m to your project.
  2. Add UIImage+animatedGIF.m to your target’s “Compile Sources” build phase, if you didn’t tell Xcode to do that when you performed step 1.
  3. Add ImageIO.framework to your target’s "Link Binary With Libraries" build phase.

Implementation notes

The implementation of this category uses the Image I/O Framework to extract the images and durations from the GIF data.

Diego Peinador provided the inspiration for handling variable-frame-rate animations, although I didn’t end up using his code.

Copyright or lack thereof

The contents of this repository are dedicated to the public domain, in accordance with the CC0 1.0 Universal Public Domain Dedication, which is reproduced in the file COPYRIGHT.

Author: Rob Mayoff
2012-01-27

Latest podspec

{
    "name": "UIImage+animatedGif",
    "version": "0.1.0",
    "summary": "Adds animatedGifWithAnimatedGifData methods to UIImage.",
    "description": "                  This project defines a category `animatedGIF` on `UIImage`.  The category defines two methods.  This method creates an animated `UIImage` using the frames of the GIF in `data`:nn                      +[UIImage animatedImageWithAnimatedGIFData:(NSData *)data]nn                  This method creates an animated `UIImage` using the frames of the GIF loaded from `url`:nn                      +[UIImage animatedImageWithAnimatedGIFURL:(NSURL *)url]n",
    "homepage": "https://github.com/jesseditson/uiimage-from-animated-gif",
    "license": {
        "type": "CC0 1.0",
        "file": "COPYRIGHT"
    },
    "authors": {
        "Rob Mayoff": "[email protected]",
        "Jesse Ditson": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jesseditson/uiimage-from-animated-gif.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "6.0"
    },
    "requires_arc": true,
    "source_files": "uiimage-from-animated-gif/UIImage+animatedGif.{h,m}",
    "frameworks": [
        "UIKit",
        "ImageIO"
    ]
}

Pin It on Pinterest

Share This