{"id":13902807,"url":"https://github.com/dtorres/OLImageView","last_synced_at":"2025-07-18T00:32:10.765Z","repository":{"id":5581586,"uuid":"6787650","full_name":"dtorres/OLImageView","owner":"dtorres","description":"Animated GIFs implemented the right way","archived":false,"fork":false,"pushed_at":"2018-06-08T18:11:59.000Z","size":4545,"stargazers_count":865,"open_issues_count":5,"forks_count":120,"subscribers_count":49,"default_branch":"master","last_synced_at":"2024-11-20T15:48:23.678Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dtorres.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-21T00:27:56.000Z","updated_at":"2024-08-08T08:44:22.000Z","dependencies_parsed_at":"2022-09-22T02:51:23.889Z","dependency_job_id":null,"html_url":"https://github.com/dtorres/OLImageView","commit_stats":null,"previous_names":["ondalabs/olimageview"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtorres%2FOLImageView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtorres%2FOLImageView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtorres%2FOLImageView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtorres%2FOLImageView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dtorres","download_url":"https://codeload.github.com/dtorres/OLImageView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226320606,"owners_count":17606327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T22:01:25.742Z","updated_at":"2024-11-25T11:30:30.710Z","avatar_url":"https://github.com/dtorres.png","language":"Objective-C","readme":" \nIMPORTANT: This project is no longer being maintained, please have a look at [FLAnimatedImage](https://github.com/Flipboard/FLAnimatedImage)\n\n# OLImageView (and OLImage)\nEverybody loves a good GIF. Unfortunately, Apple's implementation of UIImage doesn't support animated GIFs. OLImage and OLImageView are drop-in replacements for UIImage and UIImageView with really good support for animated GIFs.\n\n## Why did we do this?\nThere are many other classes to do this already, but they just don't work the way they should. Most existing classes:\n\n- Divide the delay between frames evenly, all the time (even if the file specifies different per-frame delays)\n- Load frames synchronously, which freezes up the main thread (especially when loading large files) and only show anything when all the frames are loaded\n\nWe tried to fix some of these issues, but we found that the experience still didn't feel quite right. After a little of digging, we found out that browsers change the frame delays on certain conditions. This implementation adopts these conditions to provide an experience that is consistent with the WebKit rendering of an animated GIF.\n\n## How to use\nAdd the header and replace UIImageView with OLImageView.\n\n**Example**\n\n    // Before (in your View Controller in this example)\n    \n\t- (void)loadView \n\t{\n\t\t[super loadView];\n\t\tself.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,200,200)];\n\t\t[self.view addSubview:self.imageView];\n\t}\n\n\n\t// After\n\t\n\t#import \"OLImageView.h\"\n\t\n\t- (void)loadView \n\t{\n\t\t[super loadView];\n\t\tself.imageView = [[OLImageView alloc] initWithFrame:CGRectMake(0,0,200,200)];\n\t\t[self.view addSubview:self.imageView];\n\t}\n\t\nNow, when you create your image instances to put in the view, you should do it with the data.\n\n**Example**\n\n    - (void)loadReceivedImageData:(NSData *)data;\n\t{\n\t\tUIImage *image = [OLImage imageWithData:data];\n\t\tself.imageView.image = image;\n\t}\n\t\n## Integration with other libs\n### AFNetworking\nThis repo includes a category to integrate OLImage with AFNetworking v1.x [UIImageView category](https://github.com/AFNetworking/AFNetworking/blob/1.x/AFNetworking/UIImageView+AFNetworking.h), which provides caching and remote URL setters.\nTo use this, just import the category where you will be using OLImageView with the AFNetworking category.\n\nUsers of AFNetworking 2.x can use any of the two provided image reponse serializers. `OLImageResponseSerializer` is a drop-in replacement for the standard AFNetworking serializer, which simply creates OLImage instances for every data:\n\n    imageView.imageResponseSerializer = [[OLImageResponseSerializer alloc] init];\n\nThose who want to keep default `AFImageResponseSerializer` behavior or need to chain many serializers, there's a strict one, only accepting image/gif: `OLImageStrictResponseSerializer`. Serializer chaining might look like this:\n\n    imageView.imageResponseSerializer =\n        [AFCompoundResponseSerializer compoundSerializerWithResponseSerializers:\n            @[[[OLImageStrictResponseSerializer alloc] init], imageView.imageResponseSerializer]];\n\nYou are more than welcome to send pull requests with categories or subclasses that integrate OLImage with other libraries.\n\n## Help us make this better\nFound a bug? A typo? Can you make the decoding faster? Feel free to fork this and send us a pull request (or file an issue).\n","funding_links":[],"categories":["Libraries","Objective-C","etc"],"sub_categories":["Objective-C"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtorres%2FOLImageView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdtorres%2FOLImageView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtorres%2FOLImageView/lists"}