Releases: Kashif-E/Kamera
1.1
Fixed
- Android photos cropped / reduced field-of-view (#136): stills were zoomed-in vs the preview because CameraK always bound a 16:9
VideoCapturealongside the photo use case, and the sharedViewPortshrank the common field of view.VideoCaptureis now bound lazily (only while recording), so photos use the full sensor FOV. Recording-lifecycle guards added (reject double-start / lens switch mid-recording; roll back a failed start). - Android captured photo aspect ratio & orientation (#136): the saved photo now matches the preview (display-driven ViewPort + capture rotation), across all four ratios × both orientations.
- Android rotation during recording (#147): a portrait↔landscape flip mid-recording no longer tears down the recording; the rebuild is deferred to finalize.
setTargetOrientation(null)reverts to the display rotation.
Changed (behavior)
targetResolutionno longer overridesaspectRatio(Android).- Display-locked activities produce photos in that orientation.
Verified on a Galaxy S23. Maven Central: io.github.kashif-mehmood-km:camerak:1.1 (+ plugins).
Kamera 1.0
Kamera (formerly CameraK) reaches 1.0 — a Kotlin Multiplatform camera library for Compose Multiplatform on Android, iOS, and Desktop.
Install
dependencies {
implementation("io.github.kashif-mehmood-km:camerak:1.0")
// optional plugins
implementation("io.github.kashif-mehmood-km:image_saver_plugin:1.0")
implementation("io.github.kashif-mehmood-km:qr_scanner_plugin:1.0")
implementation("io.github.kashif-mehmood-km:ocr_plugin:1.0")
implementation("io.github.kashif-mehmood-km:video_recorder_plugin:1.0")
implementation("io.github.kashif-mehmood-km:analyzer_plugin:1.0")
}Fixed
- Android aspect ratio mismatch (#136 → #137): a configured ratio (e.g.
RATIO_4_3) no longer produces a photo that's a crop of the full-screen field of view. The preview is now letterboxed to the configured ratio (FIT_CENTER) so what you see equals what you capture, driven by the actual screen orientation. - iOS underexposed / black photos (#138): fixed a
MemoryManagermiscalculation that reported 100% memory usage permanently, which made every capture downshift the session preset right before the shot — underexposing stills (most visibly front-camera selfies) while the preview looked fine. - Plugin lifecycle leaks (#140): plugins could stack analyzers/outputs on every camera re-init and leak coroutines/outputs past detach. All five plugins (ImageSaver, QR, OCR, Analyzer, VideoRecorder) now tear down and re-register idempotently;
pluginScopeis owned by the state holder and cancelled on shutdown; ImageSaver no longer double-saves after a re-attach; VideoRecorder guards double-start and won't hang on stop.
Added / Changed
CameraController.getAspectRatio()and an orientation-aware preview-ratio helper.- Plugin teardown APIs:
removeImageCaptureListener(...), and on iOSsafeRemoveOutput(...)/clearMetadataObjectsDelegate(). - Result flows are buffered (
DROP_OLDEST); OCR'socrFlowis re-attach-safe. - Desktop
saveImagewrites to a real per-user directory and honors the configured format. - Improved barcode/QR detection (Android + iOS),
mirrorFrontCameraoption, opt-inCameraKLogger, channels→flows for the desktop pipeline, and the removal of deprecated/legacy APIs landed in the lead-up to 1.0 — see the changelog.
Requirements
Android API 21+ (CameraX) · iOS 13+ (AVFoundation) · Desktop JDK 17+ (JavaCV).
Thanks
A huge thank you to everyone who contributed code, fixes, demos, and bug reports that got Kamera to 1.0:
@ShadAdman · @shadman-sportsgamex · @zelitomas · @adamglin0 · @Martmists-GH · @raunovillberg · @licryle · @EsmaeelNabil · @juliusspencer · @jeremylcarter · @maciek-s · @RaedGhazal · @yannickpulver · @carlosftorres · @lopspower
And special thanks to @kanphis for the detailed Android aspect-ratio (#136) and iOS exposure (#138) reports plus on-device diagnosis. 🙏
Full details in CHANGELOG.md.
0.4
0.2.0
0.1.0
What's Changed
- Add comprehensive codebase documentation and understanding guides by @Copilot in #65
- Add cameraDeviceType setupSession by @lopspower in #64
- Updates coil-network-ktor2 to coil-network-ktor3 and coil to 3.3.0 by @EsmaeelNabil in #81
- Fix image orientation issues on iOS by normalizing pixel data before … by @Kashif-E in #85
- parity issues between platforms by @Kashif-E in #86
- docs: update README with new features and deprecations by @Kashif-E in #87
- Version bump and docs by @Kashif-E in #88
New Contributors
- @Copilot made their first contribution in #65
- @lopspower made their first contribution in #64
- @EsmaeelNabil made their first contribution in #81
Full Changelog: 0.0.12...0.1.0
0.0.12
What's Changed
- Start custom grabber if provided by @Martmists-GH in #55
- Use pure-compose backend for video by @Martmists-GH in #54
- Implement user quality prioritization settings for image capture by @carlosfelipetorres1 in #57
New Contributors
- @Martmists-GH made their first contribution in #55
- @carlosfelipetorres1 made their first contribution in #57
Full Changelog: 0.0.11...0.0.12
0.0.11
What's Changed
- Ocr and orientation fix by @Kashif-E in #33
- Camera index 0 not available on Windows systems using FFmpegFrameGrabber. by @jeremylcarter in #40
- Add CameraController.setTorchMode by @maciek-s in #37
- Fix ios rapid capture by @Kashif-E in #42
New Contributors
- @jeremylcarter made their first contribution in #40
- @maciek-s made their first contribution in #37
Full Changelog: 0.0.9...0.0.11
0.0.9
0.0.8
What's Changed
- Support Torch Mode by @adamglin0 in #9
- 10 not working togglecameralens by @Kashif-E in #13
- Add CameraController.setFlashMode & getFlashMode by @raunovillberg in #20
- Implement missing torch setter in iOS by @RaedGhazal in #19
- Fix incorrect permission check in README by @raunovillberg in #21
- Fixes typo in README.MD by @yannickpulver in #22
New Contributors
- @adamglin0 made their first contribution in #9
- @raunovillberg made their first contribution in #20
- @RaedGhazal made their first contribution in #19
- @yannickpulver made their first contribution in #22
Full Changelog: 0.0.7...0.0.8