{"id":27771721,"url":"https://github.com/dragoncherry/camerapreviewcontroller","last_synced_at":"2025-08-26T11:33:35.048Z","repository":{"id":56905598,"uuid":"78500021","full_name":"DragonCherry/CameraPreviewController","owner":"DragonCherry","description":"Basic camera preview controller based on GPUImage library inside.","archived":false,"fork":false,"pushed_at":"2017-06-09T06:03:38.000Z","size":63,"stargazers_count":19,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-15T16:36:47.809Z","etag":null,"topics":["camera","capture","custom","filter","gpuimage","light","preview","torch","video"],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/DragonCherry.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":"2017-01-10T05:14:22.000Z","updated_at":"2020-09-06T03:12:57.000Z","dependencies_parsed_at":"2022-08-21T02:50:34.206Z","dependency_job_id":null,"html_url":"https://github.com/DragonCherry/CameraPreviewController","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/DragonCherry/CameraPreviewController","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DragonCherry%2FCameraPreviewController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DragonCherry%2FCameraPreviewController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DragonCherry%2FCameraPreviewController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DragonCherry%2FCameraPreviewController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DragonCherry","download_url":"https://codeload.github.com/DragonCherry/CameraPreviewController/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DragonCherry%2FCameraPreviewController/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272214419,"owners_count":24893201,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["camera","capture","custom","filter","gpuimage","light","preview","torch","video"],"created_at":"2025-04-29T23:00:08.029Z","updated_at":"2025-08-26T11:33:35.032Z","avatar_url":"https://github.com/DragonCherry.png","language":"Swift","readme":"# CameraPreviewController\n\n[![CI Status](http://img.shields.io/travis/DragonCherry/CameraPreviewController.svg?style=flat)](https://travis-ci.org/DragonCherry/CameraPreviewController)\n[![Version](https://img.shields.io/cocoapods/v/CameraPreviewController.svg?style=flat)](http://cocoapods.org/pods/CameraPreviewController)\n[![License](https://img.shields.io/cocoapods/l/CameraPreviewController.svg?style=flat)](http://cocoapods.org/pods/CameraPreviewController)\n[![Platform](https://img.shields.io/cocoapods/p/CameraPreviewController.svg?style=flat)](http://cocoapods.org/pods/CameraPreviewController)\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\nI'm writing this since I couldn't find a open source with complete basic source to start develop camera application from, and is based on GPUImage library inside.\n\nThis example contains the following features.\n\n1) front camera preview / still capture / video capture\n\n2) back camera preview / still capture / video capture\n\n3) flipping camera\n\n4) torch control\n\n5) tap to focus\n\n6) add/remove filter\n\n7) face detection\n\n8) pinch to zoom in/out\n\nI'm going to add more features that every camera application must have.\n\nPlease don't hesitate to contribute on this project. Any advice and suggestions will be greatly appreciated.\n\n### Functions\n\n- To take photo,\n\n```Swift\ntakePhoto({ image in\n    let photoVC = PhotoViewController()\n    photoVC.image = image\n    self.present(photoVC, animated: true, completion: nil)\n})\n```\n\n- To take video,\n\n```Swift\n// to start\nstartRecordingVideo()\n\n// to finish\nfinishRecordingVideo()\n\n// to handle success\nextension ViewController: CameraPreviewControllerDelegate {\n    func cameraPreview(_ controller: CameraPreviewController, didSaveVideoAt url: URL) {\n        // which is file url in temporary directory\n    }\n    func cameraPreview(_ controller: CameraPreviewController, didFailSaveVideoWithError error: Error) {\n    }\n    ...\n}\n```\n\n- To change camera,\n\n```Swift\nflipCamera()\nswitch cameraPosition {\n    // do something\n}\n```\n\n- To control torch,\n\n```Swift\ntorchMode = .on\ntorchMode = .off\ntorchMode = .auto\n```\n\n- To add, remove filters\n\n```Swift\nadd(filter: filter)\nremoveFilters()\n```\n\n- To detect face,\n\n```Swift\n// set true somewhere\nisFaceDetectorEnabled = true\n\n// handle result\nfunc cameraPreview(_ controller: CameraPreviewController, detected faceFeatures: [CIFaceFeature]?, aperture: CGRect, orientation: UIDeviceOrientation) {\n    guard let faces = faceFeatures, faces.count \u003e 0 else {\n        return\n    }\n    // do something\n}\n```\n\n## Requirements\n\nXcode8, Swift 3\n\n## Dependency\n\nSample: TinyLog, GPUImage, PureLayout, SwiftARGB, Dimmer\n\nPods: TinyLog, GPUImage, PureLayout\n\n## Installation\n\nCameraPreviewController is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"CameraPreviewController\"\n```\n\n## Author\n\nDragonCherry, dragoncherry@naver.com\n\n## License\n\nCameraPreviewController is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragoncherry%2Fcamerapreviewcontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdragoncherry%2Fcamerapreviewcontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragoncherry%2Fcamerapreviewcontroller/lists"}