ZBar SDK breaks in IOS 10

413 views Asked by At

I have used Zbar for 1D barcode scanning but after an upgrade to IOS 10 it can no longer read multiple barcodes, it reads one barcode at the time where as before it would read multiple, in addition, the Camera view shows a green rectangle that focuses in on single barcodes, I think thats why it reads only whats inside that rectangle, this never happened in IOS 9.

Anyone else seeing this?

My code is as follows and was working without issues before and please note I have removed the logic to ensure the code is as minimal as possible to reproduce the issue.

- (IBAction)transactionListViewCameraBtn_Pressed:(id)sender {

    // Below is using the Zbar lib
    // ADD: present a barcode reader that scans from the camera feed
    ZBarReaderViewController *reader = [ZBarReaderViewController new];
    reader.readerDelegate = self;
    reader.supportedOrientationsMask = ZBarOrientationMaskAll;

    ZBarImageScanner *scanner = reader.scanner;

    // EXAMPLE: disable rarely used I2/5 to improve performance
    [scanner setSymbology: ZBAR_I25
                   config: ZBAR_CFG_ENABLE
                       to: 0];

    [self presentViewController:reader animated:YES completion:nil];
    [reader viewWillAppear:NO];
}

- (void) imagePickerController: (UIImagePickerController*) reader didFinishPickingMediaWithInfo: (NSDictionary*) info {

    // ADD: get the decode results
    id<NSFastEnumeration> results = [info objectForKey: ZBarReaderControllerResults];

    ZBarSymbol *symbol = nil;

    NSString *msg = @"BarCodes:";

    for(symbol in results) {

        // TODO run createTransactionFromBarcode

        if ([NWTillHelper isDebug] == 1) {
            NSLog(@"Zbar delegate holds barcode: %@", symbol.data);
            msg = [msg stringByAppendingString:[NSString stringWithFormat:@"<-->%@", symbol.data]];
        }
    }

    NSLog(@"kalle: %@", msg);

    //[reader dismissModalViewControllerAnimated: YES];
}
0

There are 0 answers