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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?