Quantcast
Channel: Cocoanetics
Viewing all articles
Browse latest Browse all 428

AV Foundation: Code 39 Recognition Confusion

$
0
0

This is a bug report for AV Foundation. I noticed this problem when creating nice vector versions of the 1D barcodes used in figures in my book. The problem with this is that if you are scanning Code39 barcodes you have no way to determine whether it was one with or without check digit.

It’s filed as rdar://18566595 and on Open Radar.

If you enable both versions of Code39 detection (with and without Mod43 check digit) AV Foundation always reports the scanned barcode as Code39, regardless if you scan a version with or without check digit. The check digit is then output as extra character.

Steps to Reproduce

  1. Set up a metadata output to scan for AVMetadataObjectTypeCode39Code and AVMetadataObjectTypeCode39Mod43Code
  2. Create a Code39mod43 with contents “CONTENTS”
  3. Scan a Code39 barcode with Mod43 check digit

Expected Results

  • code should be reported as “org.iso.Code39Mod43″
  • code content should be “CONTENTS”

Actual Results

  • code is reported as “org.iso.Code39″
  • code contents is “CONTENTSA” (extra character)

Notes

If you remove the AVMetadataObjectTypeCode39Code type from the metadata output, then the scanned barcode is reported as described in expected results.

So the detection order might be the wrong way around. The problem is – as a developer – I have way to know which of the both Code39 variants was actually scanned. And thus I wouldn’t know if I can disregard the extra character.

flattr this!


Viewing all articles
Browse latest Browse all 428

Trending Articles