Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Unable to read Code 128 type barcodes #3258

Open
5 tasks done
JanilleOlegario opened this issue Oct 23, 2024 · 1 comment
Open
5 tasks done

🐛 Unable to read Code 128 type barcodes #3258

JanilleOlegario opened this issue Oct 23, 2024 · 1 comment
Labels
🐛 bug Something isn't working

Comments

@JanilleOlegario
Copy link

JanilleOlegario commented Oct 23, 2024

What's happening?

Hello!

I am trying to scan a Code 128 type of barcode but it's not recognized on the camera.

Here is a sample of the barcode.

Screenshot 2024-10-23 at 7 48 27 PM

Type upc-a is perfectly working.

Can someone please help me?
Thanks in advance!

Reproduceable Code

import {
  Camera,
  useCameraDevice,
  useCameraPermission,
  useCodeScanner,
} from 'react-native-vision-camera';  

const codeScanner = useCodeScanner({
    codeTypes: [
      'upc-a',
      'aztec',
      'codabar',
      'code-128',
      'code-39',
      'code-93',
      'data-matrix',
      'ean-13',
      'ean-8',
      'itf',
      'pdf-417',
      'qr',
      'upc-e',
    ],
    onCodeScanned: codes => {
      // console.log(`Scanned ${codes} codes!`);
      console.log(`Scanned ${JSON.stringify(codes)} codes!`);

      console.log(
        'test!!!',
        JSON.stringify(device, (k, v) => (k === 'formats' ? [] : v), 2),
      );

      const barcodeResult = codes.map(result => {
        return result.value;
      });

      console.log('test', barcodeResult[0]);

      setBarcodeText(barcodeResult[0]);
      setValue('orderId', barcodeResult[0]);
    },
  });

<Camera
   style={styles.camera}
   device={device}
   isActive={true}
   codeScanner={codeScanner}
/>

Relevant log output

> Configure project :react-native-vision-camera
[VisionCamera] Thank you for using VisionCamera ❤️
[VisionCamera] If you enjoy using VisionCamera, please consider sponsoring this project: https://github.com/sponsors/mrousavy
[VisionCamera] node_modules found at /Users/NAME/Desktop/PROJECT/marketplace/node_modules
[VisionCamera] VisionCamera_enableFrameProcessors is set to true!
[VisionCamera] react-native-worklets-core not found, Frame Processors are disabled!
[VisionCamera] VisionCamera_enableCodeScanner is set to true!

Camera Device

"formats": [],
  "sensorOrientation": "landscape-left",
  "hardwareLevel": "limited",
  "maxZoom": 4,
  "minZoom": 1,
  "maxExposure": 20,
  "supportsLowLightBoost": false,
  "neutralZoom": 1,
  "physicalDevices": [
    "wide-angle-camera"
  ],
  "supportsFocus": true,
  "supportsRawCapture": false,
  "isMultiCam": false,
  "minFocusDistance": 10,
  "minExposure": -20,
  "name": "0 (BACK) androidx.camera.camera2",
  "hasFlash": true,
  "hasTorch": true,
  "position": "back",
  "id": "0"

Device

Samsung Galaxy A34 5G

VisionCamera Version

"react-native-vision-camera": "^4.3.2"

Can you reproduce this issue in the VisionCamera Example app?

Yes, I can reproduce the same issue in the Example app here

Additional information

@JanilleOlegario JanilleOlegario added the 🐛 bug Something isn't working label Oct 23, 2024
@maintenance-hans maintenance-hans bot changed the title 🐛 Unable to read Code 128 type barcodes 🐛 Unable to read Code 128 type barcodes Oct 23, 2024
Copy link

maintenance-hans bot commented Oct 23, 2024

Guten Tag, Hans here! 🥨

It looks like you have quite a detailed report here, which is great! However, we still need to make sure we have all ze relevant information. You mentioned that you can reproduce ze issue in ze Example app, but it would be very helpful if you could provide logs from there.

You can gather logs using adb logcat for Android, which might show us why ze Code 128 barcodes aren't detected. It's important for mrousavy to have those logs to investigate further.

And remember, feel free to support ze project by sponsoring mrousavy here if you find it useful!

Looking forward to your updates!

Note: If you think I made a mistake, please ping @mrousavy to take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant