{"action":"created","issue":{"url":"https://api.github.com/repos/TheLevelUp/ZXingObjC/issues/245","labels_url":"https://api.github.com/repos/TheLevelUp/ZXingObjC/issues/245/labels{/name}","comments_url":"https://api.github.com/repos/TheLevelUp/ZXingObjC/issues/245/comments","events_url":"https://api.github.com/repos/TheLevelUp/ZXingObjC/issues/245/events","html_url":"https://github.com/TheLevelUp/ZXingObjC/issues/245","id":106517766,"number":245,"title":"Can not decode a local Image, But can scan the image","user":{"login":"jiazi11","id":10018277,"avatar_url":"https://avatars.githubusercontent.com/u/10018277?v=3","gravatar_id":"","url":"https://api.github.com/users/jiazi11","html_url":"https://github.com/jiazi11","followers_url":"https://api.github.com/users/jiazi11/followers","following_url":"https://api.github.com/users/jiazi11/following{/other_user}","gists_url":"https://api.github.com/users/jiazi11/gists{/gist_id}","starred_url":"https://api.github.com/users/jiazi11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiazi11/subscriptions","organizations_url":"https://api.github.com/users/jiazi11/orgs","repos_url":"https://api.github.com/users/jiazi11/repos","events_url":"https://api.github.com/users/jiazi11/events{/privacy}","received_events_url":"https://api.github.com/users/jiazi11/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-15T09:25:00Z","updated_at":"2015-10-06T22:07:08Z","closed_at":null,"body":"![2015042003](https://cloud.githubusercontent.com/assets/10018277/9872723/deffa520-5bcd-11e5-9764-1e1b2e846a61.jpg)\r\n\r\nuser ZXingObjec to decode the local image above,  my code like :\r\n--------------------------------------------------------------------------------------------------------------------------------------\r\n            UIImage  *image = [info objectForKey:UIImagePickerControllerOriginalImage];\r\n            ZXLuminanceSource *source = [[ZXCGImageLuminanceSource alloc] initWithCGImage:image.CGImage];\r\n            ZXBinaryBitmap *bitmap = [ZXBinaryBitmap binaryBitmapWithBinarizer:[ZXHybridBinarizer binarizerWithSource:source]];\r\n            NSError *error = nil;\r\n            ZXDecodeHints *hints = [ZXDecodeHints hints];\r\n            ZXMultiFormatReader *reader = [ZXMultiFormatReader reader];\r\n            ZXResult *result = [reader decode:bitmap\r\n                                        hints:hints\r\n                                        error:&error];\r\n            if (result) {\r\n                NSString *contents = result.text;\r\n                ZXBarcodeFormat format = result.barcodeFormat;\r\n            }\r\n--------------------------------------------------------------------------------------------------------------------------------------\r\nError Domain=ZXErrorDomain Code=1002 \"A barcode was not found in this image\" UserInfo=0x174469f40 {NSLocalizedDescription=A barcode was not found in this image}\r\n--------------------------------------------------------------------------------------------------------------------------------------\r\n\r\nCould you help to solve this problem"},"comment":{"url":"https://api.github.com/repos/TheLevelUp/ZXingObjC/issues/comments/146016387","html_url":"https://github.com/TheLevelUp/ZXingObjC/issues/245#issuecomment-146016387","issue_url":"https://api.github.com/repos/TheLevelUp/ZXingObjC/issues/245","id":146016387,"user":{"login":"benjohnde","id":5439810,"avatar_url":"https://avatars.githubusercontent.com/u/5439810?v=3","gravatar_id":"","url":"https://api.github.com/users/benjohnde","html_url":"https://github.com/benjohnde","followers_url":"https://api.github.com/users/benjohnde/followers","following_url":"https://api.github.com/users/benjohnde/following{/other_user}","gists_url":"https://api.github.com/users/benjohnde/gists{/gist_id}","starred_url":"https://api.github.com/users/benjohnde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjohnde/subscriptions","organizations_url":"https://api.github.com/users/benjohnde/orgs","repos_url":"https://api.github.com/users/benjohnde/repos","events_url":"https://api.github.com/users/benjohnde/events{/privacy}","received_events_url":"https://api.github.com/users/benjohnde/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T22:07:08Z","updated_at":"2015-10-06T22:07:08Z","body":"The following unit tests works for your qr-code:\r\n\r\n```\r\n#import \"ZXQRCodeBlackBox7TestCase.h\"\r\n\r\n@implementation ZXQRCodeBlackBox7TestCase\r\n\r\n- (id)initWithInvocation:(NSInvocation *)invocation {\r\n  self = [super initWithInvocation:invocation\r\n                testBasePathSuffix:@\"Resources/blackbox/qrcode-7\"\r\n                     barcodeReader:[[ZXMultiFormatReader alloc] init]\r\n                    expectedFormat:kBarcodeFormatQRCode];\r\n  \r\n  if (self) {\r\n    [self addTest:1 tryHarderCount:1 rotation:270.0f];\r\n  }\r\n  \r\n  return self;\r\n}\r\n\r\n- (void)testBlackBox {\r\n  [super runTests];\r\n}\r\n\r\n@end\r\n```\r\n\r\n```\r\nTest Suite 'Selected tests' started at 2015-10-07 00:06:01.980\r\nTest Suite 'ZXQRCodeBlackBox7TestCase' started at 2015-10-07 00:06:01.981\r\nTest Case '-[ZXQRCodeBlackBox7TestCase testBlackBox]' started.\r\n2015-10-07 00:06:01.984 xctest[9875:1200485] Starting Resources/blackbox/qrcode-7/1.jpg\r\n2015-10-07 00:06:02.052 xctest[9875:1200485] Rotation 270 degrees:\r\n2015-10-07 00:06:02.052 xctest[9875:1200485]   1 of 1 images passed (1 required)\r\n2015-10-07 00:06:02.052 xctest[9875:1200485]     0 failed due to misreads, 0 not detected\r\n2015-10-07 00:06:02.052 xctest[9875:1200485]   1 of 1 images passed with try harder (1 required)\r\n2015-10-07 00:06:02.053 xctest[9875:1200485]     0 failed due to misreads, 0 not detected\r\n2015-10-07 00:06:02.053 xctest[9875:1200485] TOTALS:\r\nDecoded 2 images out of 2 (100%, 2 required)\r\nTest Case '-[ZXQRCodeBlackBox7TestCase testBlackBox]' passed (0.072 seconds).\r\nTest Suite 'ZXQRCodeBlackBox7TestCase' passed at 2015-10-07 00:06:02.054.\r\n\t Executed 1 test, with 0 failures (0 unexpected) in 0.072 (0.073) seconds\r\nTest Suite 'Selected tests' passed at 2015-10-07 00:06:02.055.\r\n\t Executed 1 test, with 0 failures (0 unexpected) in 0.072 (0.075) seconds\r\nProgram ended with exit code: 0\r\n```"}}