AnimatedGIFImageSerialization

Complete Animated GIF Support for iOS, with Functions, NSJSONSerialization-style Class, and (Optional) UIImage Swizzling

  • Owner: mattt/AnimatedGIFImageSerialization
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

AnimatedGIFImageSerialization

This library is no longer maintained.
In iOS 13+ and macOS 10.15+, use CGAnimateImageAtURLWithBlock instead.

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

By default, UIImage initializers can't decode animated images from GIF files.
This library uses swizzling to provide this functionality for you.
To opt out of this behavior,
set ANIMATED_GIF_NO_UIIMAGE_INITIALIZER_SWIZZLING in your build environment.
If you're using CocoaPods,
you can add this build setting to your Podfile:

post_install do, r, r.pods_project.targets.each do, target, if target.name == 'AnimatedGIFImageSerialization' then
      target.build_configurations.each do, config, config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'], =
          ['$(inherited)', 'ANIMATED_GIF_NO_UIIMAGE_INITIALIZER_SWIZZLING=1']
      end
    end
  end
end

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 (@mattt)

License

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

Main metrics

Overview
Name With Ownermattt/AnimatedGIFImageSerialization
Primary LanguageObjective-C
Program languageObjective-C (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2014-03-25 18:06:31
Pushed At2019-07-06 14:55:26
Last Commit At2019-07-06 07:55:25
Release Count6
Last Release Name0.2.3 (Posted on )
First Release Name0.0.1 (Posted on )
用户参与
Stargazers Count1.1k
Watchers Count26
Fork Count103
Commits Count48
Has Issues Enabled
Issues Count17
Issue Open Count0
Pull Requests Count5
Pull Requests Open Count0
Pull Requests Close Count12
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private