Git Product home page Git Product logo

xanimatedimage's Introduction

XAnimatedImage: Performant animated GIF engine for iOS (FLAnimatedImage in Swift)

Platform

XAnimatedImage is a performant animated GIF engine for iOS written in Swift based on FLAnimatedImage. An illustration is shown below:

XAnimatedImage playing multiple GIFs

Features

  • Plays multiple GIFs simultaneously with a playback speed comparable to desktop browsers
  • Honors variable frame delays
  • Eliminates delays or blocking during the first playback loop
  • Interprets the frame delays of fast GIFs the same way modern browsers do

Who is this for?

  • Apps that don't support animated GIFs yet
  • Apps that already support animated GIFs but want a higher performance solution
  • People who want to tinker with the code (the corresponding blog post describing the original FLAnimatedImage repo is a great place to start; also see the To Do section below)

Requirements

  • iOS 7.1+
  • Xcode 7.1+

Installation

XAnimatedImage, like it's original counterpart FLAnimatedImage, is a well encapsulated drop-in component. Simply replace your UIImageView instances with instances of XAnimatedImageView to get animated GIF support. There is no central cache or state to manage.

Manually

You can integrate XAnimatedImage into your project manually. You can do it by copying the "Classes" folder in your project (make sure that "Create groups" option is selected).

Other

Other installation methods are currently being integrated into the project. Currently, this repository supports only manual installation. Planned, future installation methods will include:

  • CocoaPods
  • Carthage

##Usage

var animatedImage = XAnimatedImage(initWithAnimatedGIFData: NSData(contentsOfURL: NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("example", ofType: "gif")!))!)
var animatedImageView = XAnimatedImageView()
animatedImageView.animatedImage = animatedImage
animatedImageView.frame = CGRectMake(0,0,100,100)
self.view.addSubview(animatedImageView)

##To Do

  • Support other animated image formats such as APNG or WebP
  • Integration into network libraries and image caches
  • Investigate whether FLAnimatedImage should become a UIImage subclass
  • Smarter buffering
  • Investigate the usage of GPUImage for less CPU intensive image processing.
  • Support CocoaPods and Carthage for installation methods.

##Contributions

This project owes most in part to the original FLAnimatedImage contributors namely Raphael Schaad (github | @raphaelschaad).

If there any issues to be directed at me, you can reach me, Khaled Taha, @iamktothed.

xanimatedimage's People

Contributors

khaledmtaha avatar

Stargazers

Tex avatar Joan Duat avatar  avatar Yasin ATEŞ avatar Erekle Meskhi avatar  avatar mdeora avatar Daniel avatar Ely Dantas avatar Ian Martinez avatar ShadowParticle avatar yunyuchen avatar Marco Túlio avatar Ken Tominaga avatar  avatar Tommie N. Carter, Jr. avatar Andy avatar Michael D avatar  avatar 김현준 avatar  avatar Scott Delly avatar Maicon Borges avatar Asahi avatar Raul G avatar  avatar Gustavo Severo avatar Joe Ferrucci avatar shima avatar icek avatar Sheikh Imtiaz Hossain avatar Chillon avatar Sander Soots avatar Kevin avatar JDragon avatar Vinnichenko Dmitry avatar Robert-Hein Hooijmans avatar Srinivas avatar Basic Element avatar chenxxxxxxxxxwang avatar SongMengLong avatar SunShijia avatar HaviLee avatar Taufik Obet avatar Shadow avatar joker avatar  avatar Xavier avatar 东方宜玲 avatar  avatar  avatar coderHooge avatar Cons Bulaqueña avatar  avatar Zener avatar Erich Ocean avatar  avatar Nick Doherty avatar  avatar Jayven Nhan avatar LCJ avatar  avatar Geek Duan avatar Jared avatar  avatar Błażej Wdowikowski avatar doramong avatar Mykola Stukalo avatar Julian Ferdman avatar  avatar  avatar Marty Kausas avatar Zhuang Xu avatar He, Yong(LEON) avatar Chenhui Hu avatar Seong Hoon Lee avatar Roman Nekipelov avatar Stephen Radford avatar Anthony avatar  avatar David Toth avatar  avatar Yasuaki Goto avatar junhyi park avatar Zia Amini avatar RoberChen avatar Zefeng Lu avatar Van avatar Philip Kluz avatar Armaan Gupta avatar AbnerPei avatar Yansong Li avatar Annie Shih avatar hongxi avatar Huong Do avatar  avatar Will avatar KeepMoving avatar Aark avatar Osagie Igbinosa avatar

Watchers

 avatar  avatar James Cloos avatar MohsinAli avatar  avatar  avatar Carabineiro avatar  avatar  avatar  avatar Janak avatar  avatar  avatar  avatar George Leonidas avatar Mudith Chathuranga Silva avatar  avatar

xanimatedimage's Issues

Asynchronous issue.

There seem to be issues when trying to load gifs asynchronously. Most of the time it crashes because of nil values. It also seems to be the case when you swap out a gif for another one.

App crashes when internet connections gets disconnected(Grabbing the NSURL from online)

I am using this animatedImage with a URL from online
let urlString = "URLFROMINTERNET"
let animatedImage = XAnimatedImage(initWithAnimatedGIFData: NSData(contentsOfURL: NSURL(string: urlString!)!)!)

Everything is good, but if I was to put the app into aeroplane mode and scroll though the tableview where the animated image is displayed it will crash with the error
fatal error: unexpectedly found nil while unwrapping an Optional value

Any ideas how to stop this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.