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

❓ The screen size is different before and after shooting (Android)

Open PYSoYa opened this issue 1 year ago • 3 comments

Question

const device = useCameraDevice('back', { physicalDevices: ['wide-angle-camera'], });

const cameraRef = useRef(null);

const format = useCameraFormat(device, [ { photoAspectRatio: Platform.OS === 'android' ? 1 : undefined, }, { photoResolution: { width: 1080, height: 1080, }, }, ]);

    <Camera
      device={device}
      ref={cameraRef}
      isActive={true}
      photo={true}
      video={false}
      format={format}
      style={{
        width: width,
        height: width,
      }}
    />

before after

What I tried

No response

VisionCamera Version

3.6.4

Additional information

PYSoYa avatar Dec 04 '23 07:12 PYSoYa

im having the same problem :/

Felipe-OT avatar Dec 05 '23 18:12 Felipe-OT

@Felipe-OT Found it After setting the videoAspectTatio, the preview size and the size of the captured photo matched

PYSoYa avatar Dec 06 '23 00:12 PYSoYa

Worked. Thanks!

Felipe-OT avatar Dec 12 '23 00:12 Felipe-OT