{"id":17211092,"url":"https://github.com/zadr/clicktogif","last_synced_at":"2025-03-25T12:17:57.486Z","repository":{"id":10783995,"uuid":"13052514","full_name":"zadr/ClickToGIF","owner":"zadr","description":"A NSOperation subclass that builds a UIImage out of the first frame of an animated GIF.","archived":false,"fork":false,"pushed_at":"2015-10-28T23:05:42.000Z","size":3683,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-30T11:14:06.425Z","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":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zadr.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":"2013-09-24T02:17:08.000Z","updated_at":"2020-06-27T13:36:35.000Z","dependencies_parsed_at":"2022-08-30T01:40:35.413Z","dependency_job_id":null,"html_url":"https://github.com/zadr/ClickToGIF","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zadr%2FClickToGIF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zadr%2FClickToGIF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zadr%2FClickToGIF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zadr%2FClickToGIF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zadr","download_url":"https://codeload.github.com/zadr/ClickToGIF/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245458711,"owners_count":20618697,"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-10-15T02:56:13.779Z","updated_at":"2025-03-25T12:17:57.451Z","avatar_url":"https://github.com/zadr.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Download the first frame of an animated gif, instead of the full thing.\n\nexample usages:\n```swift\n\tfunc example() {\n\t\tlet url = NSBundle.mainBundle().URLForResource(\"puppy\", withExtension: \"gif\")!\n\t\tlet operation = CQIntroductoryGIFFrameOperation(URL: url)\n\n\t\t// note: `completionBlock` is also available from NSOperation, although it\n\t\t// works based off of KVO states, and will take an extra runloop or two to fire.\n\t\toperation.target = self\n\t\toperation.action = \"gifProcessed:\"\n\n\t\tNSOperationQueue.mainQueue().addOperation(operation)\n\t}\n\n\t@objc func gifProcessed(operation: CQIntroductoryGIFFrameOperation) {\n\t\tif let image = operation.introductoryFrameImageData {\n\t\t\tprint(\"we have a still image of the first frame of an animated gif!\")\n\t\t}\n\t}\n```\n\nor\n\n```swift\n\tfunc example() {\n\t\tlet url = NSBundle.mainBundle().URLForResource(\"puppy\", withExtension: \"gif\")!\n\t\tlet operation = CQIntroductoryGIFFrameOperation(URL: url)\n\t\toperation.completionBlock = {\n\t\t\tif let image = operation.introductoryFrameImageData {\n\t\t\t\tprint(\"we have a still image of the first frame of an animated gif!\")\n\t\t\t}\n\t\t}\n\n\t\tNSOperationQueue.mainQueue().addOperation(operation)\n\t}\n```\n\n(Or go straight to the code, in CQIntroductoryGIFFrameOperationHarness/CQIntroductoryGIFFrameOperation{.h, .m}.)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzadr%2Fclicktogif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzadr%2Fclicktogif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzadr%2Fclicktogif/lists"}