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

🐛 Codabar Barcodes Without Start/End Characters Are Not Recognized #3348

Open
3 of 5 tasks
ShenFTang opened this issue Jan 3, 2025 · 1 comment
Open
3 of 5 tasks
Labels
🐛 bug Something isn't working

Comments

@ShenFTang
Copy link

What's happening?

I noticed an issue with Codabar barcode recognition. Specifically, the package only recognizes Codabar barcodes that start and end with the characters A, B, C, or D (ex, A123456789B).

Based on my research, while these start and end characters are commonly used, they are optional for Codabar barcodes. However, the package appears to require them for proper recognition. As a result, Codabar barcodes that do not include these start and end characters (ex, 123456789) are not detected by the code scanner.
Codabarcode-with start and end letter
Codabarcode-without start and end letter

Reproduceable Code

const device = useCameraDevice("back");
const format = useCameraFormat(device, [
  { photoAspectRatio: 1 / DEFAULT_CAMERA_ASPECT_RATIO },
  { videoAspectRatio: 1 / DEFAULT_CAMERA_ASPECT_RATIO },
  { videoResolution: "max" },
]);
const codeScanner = useCodeScanner({
  codeTypes: ["codabar"],
  onCodeScanned: (codes) => {
    console.log("codes[0] :>> ", codes[0]);
  },
});

/.../

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

Relevant log output

Nothing logged with `console.log`

Camera Device

{
  "minFocusDistance": 20,
  "neutralZoom": 1,
  "maxZoom": 123.75,
  "physicalDevices": [
    "wide-angle-camera"
  ],
  "supportsLowLightBoost": false,
  "name": "Back Camera",
  "minZoom": 1,
  "hardwareLevel": "full",
  "maxExposure": 8,
  "supportsRawCapture": false,
  "isMultiCam": false,
  "formats": [],
  "hasTorch": true,
  "id": "com.apple.avfoundation.avcapturedevice.built-in_video:0",
  "minExposure": -8,
  "position": "back",
  "supportsFocus": true,
  "sensorOrientation": "portrait",
  "hasFlash": true
}

Device

iPhone 14 Pro (iOS 18.1.1)

VisionCamera Version

3.32.0

Can you reproduce this issue in the VisionCamera Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

Additional information

@ShenFTang ShenFTang added the 🐛 bug Something isn't working label Jan 3, 2025
Copy link

Guten Tag, Hans here. 🍻 Thank you for your detailed report! It looks like you're experiencing an issue with Codabar barcode recognition.

From your description, it seems valid that the library is not recognizing Codabar barcodes without start and end characters, which might be a bug. However, I noticed you did not provide any logs to assist in troubleshooting—Mrousavy will need those to understand what's happening. Please ensure you log messages in your environment, such as using adb logcat for Android or checking the Xcode logs for iOS.

Additionally, I recommend trying to reproduce this issue in the VisionCamera Example app, which can help narrow down the problem.

If you're finding these issues prevalent, consider supporting the project through sponsorship for even more assistance and quicker responses!

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