Quellcode durchsuchen

图片二维码识别结果增加类型判断

liuql6 vor 5 Jahren
Ursprung
Commit
7537b0e6b8

BIN
IPUCommon/IPUMobileFunc.framework/IPUMobileFunc


+ 7 - 4
IPUMobileFunc/IPUMobileFunc/Camera/IPUCameraPlugin.m

@ -369,12 +369,15 @@ BOOL base64;
369 369
            CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeQRCode
370 370
                                                      context:nil
371 371
                                                      options:@{CIDetectorAccuracy : CIDetectorAccuracyHigh}];
372
            NSArray <CIQRCodeFeature *>*features = [detector featuresInImage:detectImage options:nil];
372
            NSArray <CIFeature *>*features = [detector featuresInImage:detectImage options:nil];
373 373
            __block NSMutableArray *detetorResults = [NSMutableArray arrayWithCapacity:features.count];
374 374
            if (features && features.count) {
375
                [features enumerateObjectsUsingBlock:^(CIQRCodeFeature * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
376
                    if ([IPUStringUtility isValiteString:obj.messageString]) {
377
                        [detetorResults addObject:obj.messageString];
375
                [features enumerateObjectsUsingBlock:^(CIFeature * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
376
                    if ([obj.type isEqualToString:CIFeatureTypeQRCode]) {
377
                        CIQRCodeFeature *feature = (CIQRCodeFeature *)obj;
378
                        if ([IPUStringUtility isValiteString:feature.messageString]) {
379
                            [detetorResults addObject:feature.messageString];
380
                        }
378 381
                    }
379 382
                }];
380 383
            }

BIN
display-center/display-center.xcworkspace/xcuserdata/benny.xcuserdatad/UserInterfaceState.xcuserstate