AnimatedGIFImageSerialization

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

  • 所有者: mattt/AnimatedGIFImageSerialization
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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.

主要指标

概览
名称与所有者mattt/AnimatedGIFImageSerialization
主编程语言Objective-C
编程语言Objective-C (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2014-03-25 18:06:31
推送于2019-07-06 14:55:26
最后一次提交2019-07-06 07:55:25
发布数6
最新版本名称0.2.3 (发布于 )
第一版名称0.0.1 (发布于 )
用户参与
星数1.1k
关注者数26
派生数103
提交数48
已启用问题?
问题数17
打开的问题数0
拉请求数5
打开的拉请求数0
关闭的拉请求数12
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?