Note that there are some explanatory texts on larger screens.

plurals
  1. POWrong decoding of barcodes also in ZBAR SDK example
    text
    copied!<p>I am using the ZBarSDK with a project for iPhone. </p> <p>I am using ZBar as an embeded reader. Basically hooking up a UIView in Interface Builder. Changing the class to <code>ZBarReaderView</code> and implementing the delegate method <code>-(void)readerView: (ZBarReaderView*) view didReadSymbols: (ZBarSymbolSet*) syms fromImage: (UIImage*) img</code>.</p> <p>This works fine most of the time. There are however barcodes that apparently do not scan correctly. The first block gets interpreted wrong. I get something like <code>5008914...</code> the next time I get <code>7001814...</code> and then I get the correct <code>4001954...</code></p> <p>I went back to the "EmbedReader" example from the SDK and looked to see if I could find any tweaks that might need to be made and discovered that it too produced the same error. If I look at the example "ReaderSample" the error does not occur, however this useses an instance of <code>ZBarReaderViewController</code>. </p> <p>I then tried to change the <code>ZBAR_CFG_X_DENSITY</code> and <code>ZBAR_CFG_Y_DENSITY</code> both to 3 in my <code>viewWillAppear</code> method, but that had no influence.</p> <p>What is the difference between the scan mechanism of <code>ZBarReaderViewController</code> and <code>ZBarReaderView</code>? What can I do to supress wrong results?</p> <p>Thanks</p> <p>Here some relevant code snippets. </p> <p>In the .h</p> <pre><code>@interface ScanVC:UIViewController&lt;ZBarReaderViewDelegate&gt; { IBOutlet ZBarReaderView *readerView; ... } ... @property (nonatomic, retain) IBOutlet ZBarReaderView *readerView; ... </code></pre> <p>In the .m</p> <pre><code>@synthesize readerView; ... -(void) viewDidAppear: (BOOL) animated { [[readerView scanner] setSymbology:0 config:ZBAR_CFG_X_DENSITY to: 3]; [[readerView scanner] setSymbology:0 config:ZBAR_CFG_Y_DENSITY to: 3]; [[readerView scanner] setSymbology:ZBAR_I25 config:ZBAR_CFG_ENABLE to:0]; [readerView start]; } ... - (void) readerView: (ZBarReaderView*) view didReadSymbols: (ZBarSymbolSet*) syms fromImage: (UIImage*) img { for(ZBarSymbol *sym in syms) { ... } ... } ... -(void)viewDidLoad { [readerView setDelegate: self]; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload