Async GIF image decoder and Image viewer supporting play GIF images. It just use very less memory.

Related tags

GIF YLGIFImage
Overview

YLGIFImage

Asynchronized GIF image class and Image viewer supporting play/stop GIF images.

It just use very less memory. Following GIF usually will cost almost 600MB memory if it is fully decoded (800x600x389x4 Bytes), but using YLGIFImage, it just use about 30MB memory.

For this gif file, iOS Pinterest also will crash, but using YLGIFImage, it won't!

####Swift support I created another project to implement YLGIFImage using swift, it's called YLGIFImage-Swift.

####Get Start Using CocoaPods to get start, you can add following line to your Podfile:

pod 'YLGIFImage'

####Using it For using YLGIFImage, it's very simple:

YLImageView* imageView = [[YLImageView alloc] initWithFrame:CGRectMake(0, 160, 320, 240)];
[self.view addSubview:imageView];
imageView.image = [YLGIFImage imageNamed:@"joy.gif"];

Here is the demo looks like:

Thanks

Thanks to OLImageView! I referred a lot to this project, especially using CADisplayLink to play the animation.

Comments
  • Exception when using images from URL

    Exception when using images from URL

    In my app such exception thrown:

    Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull _isResizable]: unrecognized selector sent to instance 0x254e068'
    

    the code where I'm using the lib is as follows:

    NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:item.thumbnail]];
    UIImage *img = [YLGIFImage imageWithData:imageData];
    cell.itemThumb.image = img;
    
    opened by voronianski 5
  • Fixes #5 7.1 crash regarding [NSNull _isResizable]

    Fixes #5 7.1 crash regarding [NSNull _isResizable]

    It seems in iOS 7.1 there was a change to [UIImageView setImage:] that was raising an NSInvalidArgumentException due to an unrecognized selector (_isResizable) being sent to an instance (NSNull)

    opened by Tyr0 3
  • I found a more serious problem

    I found a more serious problem

    UICollectionView 900 pictures when the sliding speed will cause UICollectionView reuse problems, leading to the use of the entire project to YLImageView controls are problems currently found in high-speed sliding reuse problem occurs, exit the view controller, dealloc this function has not been called

    opened by Yexinglong 1
  • Setting an UIImage to YLImageView not shown under iOS8

    Setting an UIImage to YLImageView not shown under iOS8

    Hi, Thanks for your excellent work. Recently I found when trying to set an UIImage to YLImageView under iOS8, the image does not shown as expected sometimes. The problem can be reproduced by calling [aYLImageView setImage:anUIImageInstance]; under iOS8. I found this can be fixed by comment out line 106 in YLImageView.m:

    - (void)setAnimatedImage:(YLGIFImage *)animatedImage
    {
        _animatedImage = animatedImage;
        if (animatedImage == nil) {
           //self.layer.contents = nil;
        }
    }
    

    I am not sure this is a proper fix. Could someone explain this? Thanks.

    opened by fanyj 1
  • Dealing with a downloaded source gif

    Dealing with a downloaded source gif

    So the gif I get is downloaded from the web, saved as an NSData instance so I can retrieve it offline. When i use the initializer imageWithData:scale: it loads the images but I get a [NSNULL isResizeable] with the debugger stopped at line 88 of YLImageView.m.

    Love what you are doing. Is there another method I should be using?

    opened by flyman27 1
  • I found a more serious problem

    I found a more serious problem

    UICollectionView900 photos asynchronous thread sliding too fast, resulting in the use of the entire project of the UIImageView, appeared determined current problems with fast asynchronous slip back problem, quit view controller, dealloc will not be called

    opened by Yexinglong 0
  • i found a high bug in your project

    i found a high bug in your project

    hello thank you for your project, and i found a bug when i run demo on my phone not simlulator. shorter to say that the memory increase with a high speed . i alloc 5 gif instances - - unfortunately,the memory has been over 200MB

    opened by CQXfly 0
Owner
Yong Li
Yong Li
Image framework for iOS to display/encode/decode animated WebP, APNG, GIF, and more.

YYImage Image framework for iOS to display/encode/decode animated WebP, APNG, GIF, and more. (It's a component of YYKit) Features Display/encode/decod

null 1.7k Dec 9, 2022
SwiftyGif - High performance & easy to use Gif engine

SwiftyGif High performance & easy to use Gif engine Features UIImage and UIImageView extension based Remote GIFs with customizable loader Great CPU/Me

Alexis Creuzot 1.7k Jan 3, 2023
High performance and delightful way to play with APNG format in iOS.

APNGKit is a high performance framework for loading and displaying APNG images in iOS and macOS. It's built with high-level abstractions and brings a

Wei Wang 2.1k Jan 2, 2023
Complete Animated GIF Support for iOS, with Functions, NSJSONSerialization-style Class, and (Optional) UIImage Swizzling

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

Mattt 1.1k Sep 29, 2022
Performant animated GIF engine for iOS

FLAnimatedImage is a performant animated GIF engine for iOS: Plays multiple GIFs simultaneously with a playback speed comparable to desktop browsers H

Flipboard 7.8k Dec 29, 2022
High-performance animated GIF support for iOS in Swift

Gifu adds protocol-based, performance-aware animated GIF support to UIKit. (It's also a prefecture in Japan). Install Swift Package Manager Add the fo

Reda Lemeden 2.8k Jan 4, 2023
XAnimatedImage is a performant animated GIF engine for iOS written in Swift based on FLAnimatedImage

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

Khaled Taha 561 Sep 9, 2022
🌠 A small UIImage extension with gif support

?? A small UIImage extension with gif support

SwiftGif 1.3k Dec 20, 2022
Convert live photos and videos into animated GIFs in iOS, or extract frames from them.

Create a GIF from the provided video file url, Or extract images from videos. This repository has been separated from original repo along with some no

gitmerge 83 May 18, 2022
A video decoder built on ffmpeg which allows libpag to use ffmpeg as its software decoder for h264 decoding.

ffavc ffavc is a video decoder built on ffmpeg which allows libpag to use ffmpeg as its software decoder for h264 decoding. Build ffmpeg First, make s

Portable Animated Graphics 8 Nov 24, 2022
BWMCoverView is a very easy to use advertising the carousel view, supports circular scrolling functions such as switching, asynchronous loading of images, animation, custom is very high.

BWMCoverView BWMCoverView is a very easy to use advertising the carousel view, supports circular scrolling functions such as switching, asynchronous l

Bi Weiming 31 Mar 10, 2021
Red Torch is a very very (very) simple iOS app that allows you to have a red torch using your screen.

RED Torch Red Torch is a very very (very) simple iOS app that allows you to have a red torch using your screen. The App is based on storyboard, so the

Jakub 0 Jan 1, 2022
Displaying very large images in limited memory environments

LargeImageDownsizing in Swift displaying very large images in limited memory environments by turning a large image on disk into a smaller image in mem

ONG_J 2 Oct 22, 2022
An extremely high-performance, lightweight, and energy-efficient pure Swift async web image loader with memory and disk caching for iOS and  Watch.

KFSwiftImageLoader KFSwiftImageLoader is an extremely high-performance, lightweight, and energy-efficient pure Swift async web image loader with memor

Kiavash Faisali 343 Oct 29, 2022
Very simple swipe-to-dismiss, supporting Auto Layout and dynamic heights

PanelPresenter Add swipe-dismiss logic to your view controller, supporting Auto Layout and dynamic heights. Installation Add this package to your proj

Pim 3 Aug 23, 2022
Letters animation allows you to click on different letters and accordingly it will animate letters in a cool way. It has a very attractive UI and is very easy to use.

Letters Animation Cool Letters Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

MindInventory 31 Oct 4, 2022
Numbers animation allows you to click on different numbers and accordingly it will animate numbers in a cool way. It has a very attractive UI and is very easy to use.

Numbers Animation Cool Numbers Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

MindInventory 31 Oct 4, 2022
Reading animation allows you to click on the different page numbers and accordingly it will animate page changes in a cool way. It has a very attractive UI and is very easy to use.

Reading Animation Cool Reading Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

MindInventory 42 Oct 4, 2022
A very useful and unique iOS library to open image picker in just few lines of code.

ImagePickerEasy A very simple solution to implement UIImagePickerController() in your application. Requirements Swift 4.2 and above Installation Image

wajeehulhassan 6 May 13, 2022
Using remote images in an application is more or less a requirement these days.

Imaginary Table of Contents Description Usage Basic Advanced Configuration ImageFetcher Installation Description Using remote images in an application

HyperRedink 597 Nov 8, 2022