AnimatedGIFImageSerialization 0.2.0

AnimatedGIFImageSerialization 0.2.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Mattt Thompson.


Downloads

Total542,358
Week0
Month23,835

Installs

Apps1,684
Pod Tries6
Test Targets257
Watch Apps3
powered by Segment

GitHub

Stars1,026
Watchers26
Forks108
Issues5
Contributors4
Pull Requests9

Code

Files2
LOCLines of Code 241


AnimatedGIFImageSerialization decodes an UIImage from Animated GIFs image data, following the API conventions of Foundation's NSJSONSerialization class.

As it ships with iOS, UIImage does not support decoding animated gifs into an animated UIImage. But so long as ANIMATED_GIF_NO_UIIMAGE_INITIALIZER_SWIZZLING is not #define'd, the this library will swizzle the UIImage initializers to automatically support animated GIFs.

Usage

Decoding

UIImageView *imageView = ...;
imageView.image = [UIImage imageNamed:@"animated.gif"];

Animated GIF

Encoding

UIImage *image = ...;
NSData *data = [AnimatedGIFImageSerialization animatedGIFDataWithImage:image
                                                              duration:1.0
                                                             loopCount:1
                                                                 error:nil];

Contact

Mattt Thompson

License

AnimatedGIFImageSerialization is available under the MIT license. See the LICENSE file for more info.