{"id":13610061,"url":"https://github.com/infinum/Android-GoldenEye","last_synced_at":"2025-04-12T22:32:34.953Z","repository":{"id":33474775,"uuid":"54713189","full_name":"infinum/Android-GoldenEye","owner":"infinum","description":"A wrapper for Camera1 and Camera2 API which exposes simple to use interface.","archived":false,"fork":false,"pushed_at":"2021-09-07T10:58:16.000Z","size":377,"stargazers_count":375,"open_issues_count":15,"forks_count":53,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-06T08:14:08.599Z","etag":null,"topics":["android","android-development","android-library","camera","camera1","camera2","kotlin","kotlin-android","kotlin-library","open-source"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/infinum.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":"2016-03-25T10:52:45.000Z","updated_at":"2025-03-07T05:42:24.000Z","dependencies_parsed_at":"2022-09-26T22:01:30.703Z","dependency_job_id":null,"html_url":"https://github.com/infinum/Android-GoldenEye","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinum%2FAndroid-GoldenEye","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinum%2FAndroid-GoldenEye/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinum%2FAndroid-GoldenEye/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinum%2FAndroid-GoldenEye/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infinum","download_url":"https://codeload.github.com/infinum/Android-GoldenEye/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248641212,"owners_count":21138164,"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":["android","android-development","android-library","camera","camera1","camera2","kotlin","kotlin-android","kotlin-library","open-source"],"created_at":"2024-08-01T19:01:40.822Z","updated_at":"2025-04-12T22:32:34.462Z","avatar_url":"https://github.com/infinum.png","language":"Kotlin","readme":"# DEPRECATION NOTICE\n\nThis library is no longer being maintained. Since it is still being actively used on many projects, we will consider fixing any potential critical bugs, but there will be no further feature development nor minor bug fixing. \n\nWe recommend migrating to [CameraX](https://developer.android.com/training/camerax). While some very simple use-cases are still easier with GoldenEye, CameraX is lifecycle-aware and is an overall more complete solution.\n\n# GoldenEye\n\n\u003cimg src='./logo.svg' width='264'/\u003e\n\n## Quick guide\n\n#### Add dependency\n\n```gradle\nimplementation 'co.infinum:goldeneye:1.1.2'\n```\n\n#### Initialize\n\n```kotlin\nval goldenEye = GoldenEye.Builder(activity).build()\n```\n\n#### Open camera\n\n```kotlin\nif (ContextCompat.checkSelfPermission(context, Manifest.permission.CAMERA)\n    == PackageManager.PERMISSION_GRANTED\n    ) {\n  /* Find back camera */\n  val backCamera = goldenEye.availableCameras.find { it.facing == Facing.BACK }\n  /* Open back camera */\n  goldenEye.open(textureView, backCamera, initCallback)\n}\n```\n\n#### Take picture\n\n```kotlin\ngoldenEye.takePicture(pictureCallback)\n```\n\n#### Record video\n\n```kotlin\ngoldenEye.startRecording(file, videoCallback)\n/* Somewhere later */\ngoldenEye.stopRecording()\n```\n\nYou can see all GoldenEye methods [here](./goldeneye/src/main/java/co/infinum/goldeneye/GoldenEye.kt).\n\n## Features\n\nGoldenEye supports multiple Camera features that can be changed at runtime:\n\n- [Flash mode](./goldeneye/src/main/java/co/infinum/goldeneye/models/FlashMode.kt)\n- [Focus mode](./goldeneye/src/main/java/co/infinum/goldeneye/models/FocusMode.kt)\n- [Preview scale](./goldeneye/src/main/java/co/infinum/goldeneye/models/PreviewScale.kt)\n- Preview size\n- Picture size\n- Picture quality\n- [Video quality](./goldeneye/src/main/java/co/infinum/goldeneye/models/VideoQuality.kt)\n- Tap to focus\n- Pinch to zoom\n- [Antibanding mode](./goldeneye/src/main/java/co/infinum/goldeneye/models/AntibandingMode.kt)\n- [White balance mode](./goldeneye/src/main/java/co/infinum/goldeneye/models/WhiteBalanceMode.kt)\n- [Color effect mode](./goldeneye/src/main/java/co/infinum/goldeneye/models/ColorEffectMode.kt)\n\nIf you are interested to read in detail what is supported, there is thorough documentation inside [interfaces](./goldeneye/src/main/java/co/infinum/goldeneye/config).\n\n## Builder\n\nWhen initializing GoldenEye instance you can configure it to fit your needs with several interfaces.\n\n#### [Logger](./goldeneye/src/main/java/co/infinum/goldeneye/Logger.kt)\n\nBy default logging is turned **OFF**. By implementing Logger interface, you can enable logs if needed.\n\n```kotlin\nobject: Logger {\n  override fun log(message: String) {\n    /* Log standard message */\n  }\n\n  override fun log(t: Throwable) {\n    /* Log error */\n  }\n}\n```\n\n#### [OnZoomChangedCallback](./goldeneye/src/main/java/co/infinum/goldeneye/Callbacks.kt)\n\nGoldenEye supports pinch to zoom functionality. By using OnZoomChangedCallback you can receive callback every time the zoom changes.\n\n```kotlin\nobject: OnZoomChangedCallback {\n  override fun onZoomChanged(zoom: Int) {\n    /* Do something */\n  }\n}\n```\n\n#### [OnFocusChangedCallback](./goldeneye/src/main/java/co/infinum/goldeneye/Callbacks.kt)\n\nGoldenEye supports tap to focus functionality. By using OnFocusChangedCallback you can receive callback every time the focus changes.\n\n```kotlin\nobject: OnFocusChangedCallback {\n  override fun onFocusChanged(point: Point) {\n    /* Do something */\n  }\n}\n```\n\n#### [PictureTransformation](./goldeneye/src/main/java/co/infinum/goldeneye/PictureTransformation.kt)\n\nOnce the picture is taken, by default, library will rotate the bitmap to be in sync with device's orientation and mirror\nthe image if it is taken with front camera. If you are not OK with this behavior, you can provide `PictureTransformation` implementation\nthat will be used instead. `PictureTransformation.transform` method is executed on the **background** thread!\n\n```kotlin\nobject: PictureTransformation {\n  override fun transform(picture: Bitmap, config: CameraConfig, orientationDifference: Float): Bitmap {\n    /* Transform raw picture */\n  }\n}\n```\n\n#### Advanced features\n\n- [Antibanding mode](./goldeneye/src/main/java/co/infinum/goldeneye/models/AntibandingMode.kt)\n- [White balance mode](./goldeneye/src/main/java/co/infinum/goldeneye/models/WhiteBalanceMode.kt)\n- [Color effect mode](./goldeneye/src/main/java/co/infinum/goldeneye/models/ColorEffectMode.kt)\n\nAdvanced features are still in experimental phase and we noticed that they do not work on some devices and they were not\nthoroughly tested so we decided to disable them by default. That means that if you try to change the value via setter, it will simply be ignored.\n\nIn case you want to try and play with advanced features, you can enable them when initializing GoldenEye instance.\n\n```kotlin\nGoldenEye.Builder(activity)\n  .withAdvancedFeatures()\n  .build()\n```\n\n#### Manually set Camera API\n\nYou can manually set Camera API and override default GoldenEye behavior. You can call `GoldenEye.preferredCameraApi(Context)` to check which\nCamera API will be used by default. It can be useful to force Camera1 API as it is more consistent when taking pictures with FlashMode.ON \nthan Camera2. The issue with Camera1 is that some newer devices would **crash** when trying to record a video so be very cautious.\n\n```kotlin\nGoldenEye.Builder(activity)\n  .setCameraApi(CameraApi.CAMERA1)\n  .build()\n```\n\n## Edge case behavior\n\n- If you call `startRecording` or `takePicture` while GoldenEye is already taking a picture or recording a video, immediate `onError`\ncallback will be dispatched for the **second** call, first call to `startRecording` or `takePicture` will still be active\n- If you call `release` while GoldenEye is taking a picture or recording a video, everything will be canceled including all callbacks,\nnothing will be dispatched\n- If you call `GoldenEye.config` before `InitCallback#onReady` is dispatched, returned `config` will be `null`\n- If you call `open` while camera is already opened, old camera will be released and closed and new camera will be opened\n\n## Known issues\n\n- Video recording with external camera is not supported due to current video configuration limitations of the internal API design\n- OnePlus 6 - ColorEffectMode does not work\n- Huawei Nexus 6P - Picture taken with Flash is too dark\n- LG G5 - Picture taken with Flash is too dark\n\n## Contributing\n\nFeedback and code contributions are very much welcome. Just make a pull request with a short description of your changes.\nBy making contributions to this project you give permission for your code to be used under the same [license](LICENSE).\n\n## Credits\n\nMaintained and sponsored by [Infinum](http://www.infinum.co).\n\n\u003ca href='https://infinum.co'\u003e\n  \u003cimg src='https://infinum.co/infinum.png' href='https://infinum.co' width='264'\u003e\n\u003c/a\u003e\n","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinum%2FAndroid-GoldenEye","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfinum%2FAndroid-GoldenEye","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinum%2FAndroid-GoldenEye/lists"}