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

Cade Scanner doesn't scan codes on the left side of screen❓

Open KingSharkG opened this issue 2 years ago • 1 comments

Question

I update my react-native app: react-native 0.69.1 -> 0.72 react-native-vision-camera 2.14.1 -> 3.6.12

Before updates I use vision-camera-code-scanner for scanning barcodes and scanner scan barcodes on full screen (and the issue was to create custom reaction zone) But after update the I set the regionOfInterest and it's not work. Also I found that on the left side of the screen zone where scanner not work (not matter use regionOfInterest or not)

The device.sensorOrientation landscape-right The screen orientation portrait

Use Android Emulator - Pixel_4_API_34

P.S. regionOfInterest - not work

Screenshot 2023-11-30 at 00 05 41 in red not scanned zone

What I tried

I tried to set the orientation in props of Camera not help. The start position of screen in top left side but start position of camera frame is top right side.

Frame: {"height": 720, "width": 1280}

Code usage:

const codeScanner = useCodeScanner({
    codeTypes: [
      'code-128',
      'code-39',
      'code-93',
      'codabar',
      'ean-13',
      'ean-8',
      'itf',
      'upc-e',
      'qr',
      'pdf-417',
      'aztec',
      'data-matrix',
    ],
    onCodeScanned: (codes, frame) => {
      console.log('🚀 ~ ScanBarcode ~ frame:', frame);

      console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
      console.log('codes', codes.length);
      console.log('code', codes?.[0]);
      console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
    },
    regionOfInterest: {
      x: layoutPosition.x,
      y: layoutPosition.y,
      width: layoutPosition.width,
      height: layoutPosition.height,
    },
  });
  
   <Camera
      style={StyleSheet.absoluteFill}
      device={device}
      isActive={isFocused}
      audio={false}
      orientation="portrait"
      codeScanner={codeScanner}
    />

VisionCamera Version

3.6.12

Additional information

KingSharkG avatar Nov 29 '23 23:11 KingSharkG

Still facing this issue

KingSharkG avatar Dec 13 '23 07:12 KingSharkG

Hey! I think this has already been fixed. If not, feel free to re-open :)

mrousavy avatar Jan 15 '24 13:01 mrousavy