{"action":"opened","number":80,"pull_request":{"url":"https://api.github.com/repos/tdginternet/TGCameraViewController/pulls/80","id":90494402,"html_url":"https://github.com/tdginternet/TGCameraViewController/pull/80","diff_url":"https://github.com/tdginternet/TGCameraViewController/pull/80.diff","patch_url":"https://github.com/tdginternet/TGCameraViewController/pull/80.patch","issue_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/issues/80","number":80,"state":"open","locked":false,"title":"Refactored saveJPGImageAtDocumentDirectory:image:resultBlock:failureBlock","user":{"login":"lichenglu","id":14342440,"avatar_url":"https://avatars.githubusercontent.com/u/14342440?v=3","gravatar_id":"","url":"https://api.github.com/users/lichenglu","html_url":"https://github.com/lichenglu","followers_url":"https://api.github.com/users/lichenglu/followers","following_url":"https://api.github.com/users/lichenglu/following{/other_user}","gists_url":"https://api.github.com/users/lichenglu/gists{/gist_id}","starred_url":"https://api.github.com/users/lichenglu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lichenglu/subscriptions","organizations_url":"https://api.github.com/users/lichenglu/orgs","repos_url":"https://api.github.com/users/lichenglu/repos","events_url":"https://api.github.com/users/lichenglu/events{/privacy}","received_events_url":"https://api.github.com/users/lichenglu/received_events","type":"User","site_admin":false},"body":"Hi, I posted an issue yesterday, and then decided to take a look at why I have the problem. I found some issues(sorry if I misunderstood your code purpose) and \"fixed\" the following:\r\n\r\n1. Refactored the way to get directory by using NSFileManager, which is recommended by Apple\r\n2. Only tried to create the image directory when the directory does NOT exist.\r\n3. Use NSFileManager to save the image to documents/Images, and trigger failure block if writing is not successful.\r\n4. Init assetURL with NSURL(fileURLWithPath:) so that the returned url can be used directly for loading the image","created_at":"2016-10-22T20:27:59Z","updated_at":"2016-10-22T20:27:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77f74c4efa65346d59f61b45dd8781b8ff066fa7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/pulls/80/commits","review_comments_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/pulls/80/comments","review_comment_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/issues/80/comments","statuses_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/statuses/5c758dbecaddea018297cd29bdc977e15c5fd5b9","head":{"label":"lichenglu:master","ref":"master","sha":"5c758dbecaddea018297cd29bdc977e15c5fd5b9","user":{"login":"lichenglu","id":14342440,"avatar_url":"https://avatars.githubusercontent.com/u/14342440?v=3","gravatar_id":"","url":"https://api.github.com/users/lichenglu","html_url":"https://github.com/lichenglu","followers_url":"https://api.github.com/users/lichenglu/followers","following_url":"https://api.github.com/users/lichenglu/following{/other_user}","gists_url":"https://api.github.com/users/lichenglu/gists{/gist_id}","starred_url":"https://api.github.com/users/lichenglu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lichenglu/subscriptions","organizations_url":"https://api.github.com/users/lichenglu/orgs","repos_url":"https://api.github.com/users/lichenglu/repos","events_url":"https://api.github.com/users/lichenglu/events{/privacy}","received_events_url":"https://api.github.com/users/lichenglu/received_events","type":"User","site_admin":false},"repo":{"id":71662836,"name":"TGCameraViewController","full_name":"lichenglu/TGCameraViewController","owner":{"login":"lichenglu","id":14342440,"avatar_url":"https://avatars.githubusercontent.com/u/14342440?v=3","gravatar_id":"","url":"https://api.github.com/users/lichenglu","html_url":"https://github.com/lichenglu","followers_url":"https://api.github.com/users/lichenglu/followers","following_url":"https://api.github.com/users/lichenglu/following{/other_user}","gists_url":"https://api.github.com/users/lichenglu/gists{/gist_id}","starred_url":"https://api.github.com/users/lichenglu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lichenglu/subscriptions","organizations_url":"https://api.github.com/users/lichenglu/orgs","repos_url":"https://api.github.com/users/lichenglu/repos","events_url":"https://api.github.com/users/lichenglu/events{/privacy}","received_events_url":"https://api.github.com/users/lichenglu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lichenglu/TGCameraViewController","description":"Custom camera with AVFoundation. Beautiful, light and easy to integrate with iOS projects.","fork":true,"url":"https://api.github.com/repos/lichenglu/TGCameraViewController","forks_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/forks","keys_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/teams","hooks_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/hooks","issue_events_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/issues/events{/number}","events_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/events","assignees_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/assignees{/user}","branches_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/branches{/branch}","tags_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/tags","blobs_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/git/refs{/sha}","trees_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/statuses/{sha}","languages_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/languages","stargazers_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/stargazers","contributors_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/contributors","subscribers_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/subscribers","subscription_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/subscription","commits_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/commits{/sha}","git_commits_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/git/commits{/sha}","comments_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/comments{/number}","issue_comment_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/issues/comments{/number}","contents_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/contents/{+path}","compare_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/merges","archive_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/downloads","issues_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/issues{/number}","pulls_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/pulls{/number}","milestones_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/milestones{/number}","notifications_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/labels{/name}","releases_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/releases{/id}","deployments_url":"https://api.github.com/repos/lichenglu/TGCameraViewController/deployments","created_at":"2016-10-22T20:06:32Z","updated_at":"2016-10-22T20:06:34Z","pushed_at":"2016-10-22T20:22:41Z","git_url":"git://github.com/lichenglu/TGCameraViewController.git","ssh_url":"git@github.com:lichenglu/TGCameraViewController.git","clone_url":"https://github.com/lichenglu/TGCameraViewController.git","svn_url":"https://github.com/lichenglu/TGCameraViewController","homepage":null,"size":1581,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tdginternet:master","ref":"master","sha":"1e2a3ddc5410f0bcdf5cf2a6dc151664f71c2c0a","user":{"login":"tdginternet","id":8483533,"avatar_url":"https://avatars.githubusercontent.com/u/8483533?v=3","gravatar_id":"","url":"https://api.github.com/users/tdginternet","html_url":"https://github.com/tdginternet","followers_url":"https://api.github.com/users/tdginternet/followers","following_url":"https://api.github.com/users/tdginternet/following{/other_user}","gists_url":"https://api.github.com/users/tdginternet/gists{/gist_id}","starred_url":"https://api.github.com/users/tdginternet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdginternet/subscriptions","organizations_url":"https://api.github.com/users/tdginternet/orgs","repos_url":"https://api.github.com/users/tdginternet/repos","events_url":"https://api.github.com/users/tdginternet/events{/privacy}","received_events_url":"https://api.github.com/users/tdginternet/received_events","type":"Organization","site_admin":false},"repo":{"id":24071588,"name":"TGCameraViewController","full_name":"tdginternet/TGCameraViewController","owner":{"login":"tdginternet","id":8483533,"avatar_url":"https://avatars.githubusercontent.com/u/8483533?v=3","gravatar_id":"","url":"https://api.github.com/users/tdginternet","html_url":"https://github.com/tdginternet","followers_url":"https://api.github.com/users/tdginternet/followers","following_url":"https://api.github.com/users/tdginternet/following{/other_user}","gists_url":"https://api.github.com/users/tdginternet/gists{/gist_id}","starred_url":"https://api.github.com/users/tdginternet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdginternet/subscriptions","organizations_url":"https://api.github.com/users/tdginternet/orgs","repos_url":"https://api.github.com/users/tdginternet/repos","events_url":"https://api.github.com/users/tdginternet/events{/privacy}","received_events_url":"https://api.github.com/users/tdginternet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tdginternet/TGCameraViewController","description":"Custom camera with AVFoundation. Beautiful, light and easy to integrate with iOS projects.","fork":false,"url":"https://api.github.com/repos/tdginternet/TGCameraViewController","forks_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/forks","keys_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/teams","hooks_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/hooks","issue_events_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/issues/events{/number}","events_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/events","assignees_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/assignees{/user}","branches_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/branches{/branch}","tags_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/tags","blobs_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/git/refs{/sha}","trees_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/statuses/{sha}","languages_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/languages","stargazers_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/stargazers","contributors_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/contributors","subscribers_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/subscribers","subscription_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/subscription","commits_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/commits{/sha}","git_commits_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/git/commits{/sha}","comments_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/comments{/number}","issue_comment_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/issues/comments{/number}","contents_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/contents/{+path}","compare_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/merges","archive_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/downloads","issues_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/issues{/number}","pulls_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/pulls{/number}","milestones_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/milestones{/number}","notifications_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/labels{/name}","releases_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/releases{/id}","deployments_url":"https://api.github.com/repos/tdginternet/TGCameraViewController/deployments","created_at":"2014-09-15T19:59:40Z","updated_at":"2016-10-22T19:45:11Z","pushed_at":"2016-10-22T20:28:01Z","git_url":"git://github.com/tdginternet/TGCameraViewController.git","ssh_url":"git@github.com:tdginternet/TGCameraViewController.git","clone_url":"https://github.com/tdginternet/TGCameraViewController.git","svn_url":"https://github.com/tdginternet/TGCameraViewController","homepage":null,"size":1581,"stargazers_count":1219,"watchers_count":1219,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":196,"mirror_url":null,"open_issues_count":14,"forks":196,"open_issues":14,"watchers":1219,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tdginternet/TGCameraViewController/pulls/80"},"html":{"href":"https://github.com/tdginternet/TGCameraViewController/pull/80"},"issue":{"href":"https://api.github.com/repos/tdginternet/TGCameraViewController/issues/80"},"comments":{"href":"https://api.github.com/repos/tdginternet/TGCameraViewController/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/tdginternet/TGCameraViewController/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/tdginternet/TGCameraViewController/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tdginternet/TGCameraViewController/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/tdginternet/TGCameraViewController/statuses/5c758dbecaddea018297cd29bdc977e15c5fd5b9"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":4,"additions":45,"deletions":39,"changed_files":1}}
{"actor":{"display_login":"lichenglu"}}