react-native-camera-kit icon indicating copy to clipboard operation
react-native-camera-kit copied to clipboard

Camare preview distorted

Open kcstechnis opened this issue 11 months ago • 0 comments

Describe the bug Our application is locked to portrait mode. On Android devices, the camera preview is distorted. Also the barcode scanner's frame out of the on the first load. Seems it always uses a 16:9 ratio, even if the rendered element has a different aspect ratio.

(I turned off the lock of portrait mode, with fixed size camera [1:1, 4:3 aspest ratio], in landscape mode, the preview was not distorted, only in portrait mode.)

To Reproduce

            <Camera
              ref={(ref: CameraApi) => (this.camera = ref)}
              flashMode="auto"
              scanBarcode
              showFrame={true}
              onReadCode={this.handleQRCode}
              style={styles.camera}
              zoomMode={"off"}
              laserColor={"white"}
              frameColor={"blue"}
            />
// I've tried with exact sizes instead of aspectRatio, got the same result.
            const styles = StyleSheet.create({
              camera: {
              width: "100%",
              aspectRatio: 1 / 1,
            },
});

Expected behavior Camera preview adapts to the element's size & aspect ratio.

Screenshots image

Smartphone (please complete the following information):

  • Device: Samsung Galaxy A13
  • OS: Android 13
  • Version 13.0.0
  • RN Version: 0.71.13

kcstechnis avatar Aug 29 '23 06:08 kcstechnis