Open alexstanbury opened 4 months ago
Took a dive on the native code on the android side, since it might be related to your usecase.
From the android native code: https://github.com/teslamotors/react-native-camera-kit/blob/master/android/src/main/java/com/rncamerakit/CKCamera.kt
...
// ImageCapture
imageCapture = ImageCapture.Builder()
.setCaptureMode(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY)
// We request aspect ratio but no resolution to match preview config, but letting
// CameraX optimize for whatever specific resolution best fits our use cases
.setTargetAspectRatio(screenAspectRatio)
// Set initial target rotation, we will have to call this again if rotation changes
// during the lifecycle of this use case
.setTargetRotation(rotation)
.build()
Seems like a lack of support for this feature than a bug. The resolutions are automatically decided by native libraries, and there isnt any public methods that return the resolution (least I couldnt find any)
You might have to do a workaround and get the resolutions from the captured temporary jpeg instead
You right @alexstanbury. height
/width
are implemented on Android, not yet on iOS.
https://github.com/teslamotors/react-native-camera-kit/blob/master/src/types.ts
export type CaptureData = {
uri: string;
name: string;
// Android only
id?: string;
path?: string;
height?: number;
width?: number;
// iOS only
size?: number;
};
I pushed a PR to get that added 👍
Describe the bug When capturing an image, I would expect there to be a height and width value returned, yet I only get the following:
To Reproduce Steps to reproduce the behavior:
capture
width
orheight
passed back.Expected behavior There should be
width
andheight
passed back, it's a fundamental part of a camera library, surely?Smartphone (please complete the following information):