{"action":"created","comment":{"url":"https://api.github.com/repos/onevcat/Kingfisher/pulls/comments/108318985","pull_request_review_id":29342509,"id":108318985,"diff_hunk":"@@ -353,19 +412,86 @@ public struct ColorControlsProcessor: ImageProcessor {\n /// Processor for applying black and white effect to images. Only CG-based images are supported.\n /// watchOS is not supported.\n public struct BlackWhiteProcessor: ImageProcessor {\n+    \n+    /// Identifier of the processor.\n+    /// - Note: See documentation of `ImageProcessor` protocol for more.\n     public let identifier = \"com.onevcat.Kingfisher.BlackWhiteProcessor\"\n     \n     /// Initialize a `BlackWhiteProcessor`\n-    ///\n-    /// - returns: An initialized `BlackWhiteProcessor`\n     public init() {}\n     \n+    /// Process an input `ImageProcessItem` item to an image for this processor.\n+    ///\n+    /// - parameter item:    Input item which will be processed by `self`\n+    /// - parameter options: Options when processing the item.\n+    ///\n+    /// - returns: The processed image.\n+    ///\n+    /// - Note: See documentation of `ImageProcessor` protocol for more.\n     public func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image? {\n         return ColorControlsProcessor(brightness: 0.0, contrast: 1.0, saturation: 0.0, inputEV: 0.7)\n             .process(item: item, options: options)\n     }\n }\n \n+/// Processor for cropping an image. Only CG-based images are supported.\n+/// watchOS is not supported.\n+public struct CroppingImageProcessor: ImageProcessor {\n+    \n+    /// Identifier of the processor.\n+    /// - Note: See documentation of `ImageProcessor` protocol for more.\n+    public let identifier: String\n+    \n+    /// Target size of output image should be.\n+    public let size: CGSize\n+    \n+    /// Anchor point from which the output size should be calculate.\n+    /// The anchor point is consisted by two values between 0.0 and 1.0.\n+    /// It indicates a related point in current image. \n+    /// See `CroppingImageProcessor.init(size:anchor:)` for more.\n+    public let anchor: CGPoint\n+    \n+    /// Initialize a `CroppingImageProcessor`\n+    ///\n+    /// - Parameters:\n+    ///   - size: Target size of output image should be.\n+    ///   - anchor: The anchor point from which the size should be calculated.\n+    ///             Default is `CGPoint(x: 0.5, y: 0.5)`, which means the center of input image.\n+    /// - Note:\n+    ///   The anchor point is consisted by two values between 0.0 and 1.0.\n+    ///   It indicates a related point in current image, eg: (0.0, 0.0) for top-left\n+    ///   corner, (0.5, 0.5) for center and (1.0, 1.0) for bottom-right corner.\n+    ///   The `size` property of `CroppingImageProcessor` will be used along with\n+    ///   `anchor` to calculate a target rectange in the size of image.\n+    ///    \n+    ///   The target size will be automatically calculated with a reasonable behavior.\n+    ///   For example, when you have an image size of `CGSize(width: 100, height: 100)`,\n+    ///   and a target size of `CGSize(width: 100, height: 100)`, with a (0.0, 0.0) anchor (top-left),","path":"Sources/ImageProcessor.swift","position":291,"original_position":291,"commit_id":"bfd540b49a932e294ab82adb8ec7a543574f22fa","original_commit_id":"bfd540b49a932e294ab82adb8ec7a543574f22fa","user":{"login":"onevcat","id":1019875,"avatar_url":"https://avatars3.githubusercontent.com/u/1019875?v=3","gravatar_id":"","url":"https://api.github.com/users/onevcat","html_url":"https://github.com/onevcat","followers_url":"https://api.github.com/users/onevcat/followers","following_url":"https://api.github.com/users/onevcat/following{/other_user}","gists_url":"https://api.github.com/users/onevcat/gists{/gist_id}","starred_url":"https://api.github.com/users/onevcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onevcat/subscriptions","organizations_url":"https://api.github.com/users/onevcat/orgs","repos_url":"https://api.github.com/users/onevcat/repos","events_url":"https://api.github.com/users/onevcat/events{/privacy}","received_events_url":"https://api.github.com/users/onevcat/received_events","type":"User","site_admin":false},"body":"Yes you are definitely right! Thanks for pointing it out.","created_at":"2017-03-28T01:46:51Z","updated_at":"2017-03-28T01:46:51Z","html_url":"https://github.com/onevcat/Kingfisher/pull/630#discussion_r108318985","pull_request_url":"https://api.github.com/repos/onevcat/Kingfisher/pulls/630","_links":{"self":{"href":"https://api.github.com/repos/onevcat/Kingfisher/pulls/comments/108318985"},"html":{"href":"https://github.com/onevcat/Kingfisher/pull/630#discussion_r108318985"},"pull_request":{"href":"https://api.github.com/repos/onevcat/Kingfisher/pulls/630"}}},"pull_request":{"url":"https://api.github.com/repos/onevcat/Kingfisher/pulls/630","id":112629388,"html_url":"https://github.com/onevcat/Kingfisher/pull/630","diff_url":"https://github.com/onevcat/Kingfisher/pull/630.diff","patch_url":"https://github.com/onevcat/Kingfisher/pull/630.patch","issue_url":"https://api.github.com/repos/onevcat/Kingfisher/issues/630","number":630,"state":"closed","locked":false,"title":"Implement crop processor","user":{"login":"onevcat","id":1019875,"avatar_url":"https://avatars3.githubusercontent.com/u/1019875?v=3","gravatar_id":"","url":"https://api.github.com/users/onevcat","html_url":"https://github.com/onevcat","followers_url":"https://api.github.com/users/onevcat/followers","following_url":"https://api.github.com/users/onevcat/following{/other_user}","gists_url":"https://api.github.com/users/onevcat/gists{/gist_id}","starred_url":"https://api.github.com/users/onevcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onevcat/subscriptions","organizations_url":"https://api.github.com/users/onevcat/orgs","repos_url":"https://api.github.com/users/onevcat/repos","events_url":"https://api.github.com/users/onevcat/events{/privacy}","received_events_url":"https://api.github.com/users/onevcat/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-03-26T14:28:39Z","updated_at":"2017-03-28T01:46:51Z","closed_at":"2017-03-26T14:36:12Z","merged_at":"2017-03-26T14:36:12Z","merge_commit_sha":"c99218536f70d638fd01ee7bc5157873f0bc890a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/onevcat/Kingfisher/pulls/630/commits","review_comments_url":"https://api.github.com/repos/onevcat/Kingfisher/pulls/630/comments","review_comment_url":"https://api.github.com/repos/onevcat/Kingfisher/pulls/comments{/number}","comments_url":"https://api.github.com/repos/onevcat/Kingfisher/issues/630/comments","statuses_url":"https://api.github.com/repos/onevcat/Kingfisher/statuses/bfd540b49a932e294ab82adb8ec7a543574f22fa","head":{"label":"onevcat:feature/crop-processor","ref":"feature/crop-processor","sha":"bfd540b49a932e294ab82adb8ec7a543574f22fa","user":{"login":"onevcat","id":1019875,"avatar_url":"https://avatars3.githubusercontent.com/u/1019875?v=3","gravatar_id":"","url":"https://api.github.com/users/onevcat","html_url":"https://github.com/onevcat","followers_url":"https://api.github.com/users/onevcat/followers","following_url":"https://api.github.com/users/onevcat/following{/other_user}","gists_url":"https://api.github.com/users/onevcat/gists{/gist_id}","starred_url":"https://api.github.com/users/onevcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onevcat/subscriptions","organizations_url":"https://api.github.com/users/onevcat/orgs","repos_url":"https://api.github.com/users/onevcat/repos","events_url":"https://api.github.com/users/onevcat/events{/privacy}","received_events_url":"https://api.github.com/users/onevcat/received_events","type":"User","site_admin":false},"repo":{"id":33486016,"name":"Kingfisher","full_name":"onevcat/Kingfisher","owner":{"login":"onevcat","id":1019875,"avatar_url":"https://avatars3.githubusercontent.com/u/1019875?v=3","gravatar_id":"","url":"https://api.github.com/users/onevcat","html_url":"https://github.com/onevcat","followers_url":"https://api.github.com/users/onevcat/followers","following_url":"https://api.github.com/users/onevcat/following{/other_user}","gists_url":"https://api.github.com/users/onevcat/gists{/gist_id}","starred_url":"https://api.github.com/users/onevcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onevcat/subscriptions","organizations_url":"https://api.github.com/users/onevcat/orgs","repos_url":"https://api.github.com/users/onevcat/repos","events_url":"https://api.github.com/users/onevcat/events{/privacy}","received_events_url":"https://api.github.com/users/onevcat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/onevcat/Kingfisher","description":"A lightweight, pure-Swift library for downloading and caching images from the web.","fork":false,"url":"https://api.github.com/repos/onevcat/Kingfisher","forks_url":"https://api.github.com/repos/onevcat/Kingfisher/forks","keys_url":"https://api.github.com/repos/onevcat/Kingfisher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onevcat/Kingfisher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onevcat/Kingfisher/teams","hooks_url":"https://api.github.com/repos/onevcat/Kingfisher/hooks","issue_events_url":"https://api.github.com/repos/onevcat/Kingfisher/issues/events{/number}","events_url":"https://api.github.com/repos/onevcat/Kingfisher/events","assignees_url":"https://api.github.com/repos/onevcat/Kingfisher/assignees{/user}","branches_url":"https://api.github.com/repos/onevcat/Kingfisher/branches{/branch}","tags_url":"https://api.github.com/repos/onevcat/Kingfisher/tags","blobs_url":"https://api.github.com/repos/onevcat/Kingfisher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onevcat/Kingfisher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onevcat/Kingfisher/git/refs{/sha}","trees_url":"https://api.github.com/repos/onevcat/Kingfisher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onevcat/Kingfisher/statuses/{sha}","languages_url":"https://api.github.com/repos/onevcat/Kingfisher/languages","stargazers_url":"https://api.github.com/repos/onevcat/Kingfisher/stargazers","contributors_url":"https://api.github.com/repos/onevcat/Kingfisher/contributors","subscribers_url":"https://api.github.com/repos/onevcat/Kingfisher/subscribers","subscription_url":"https://api.github.com/repos/onevcat/Kingfisher/subscription","commits_url":"https://api.github.com/repos/onevcat/Kingfisher/commits{/sha}","git_commits_url":"https://api.github.com/repos/onevcat/Kingfisher/git/commits{/sha}","comments_url":"https://api.github.com/repos/onevcat/Kingfisher/comments{/number}","issue_comment_url":"https://api.github.com/repos/onevcat/Kingfisher/issues/comments{/number}","contents_url":"https://api.github.com/repos/onevcat/Kingfisher/contents/{+path}","compare_url":"https://api.github.com/repos/onevcat/Kingfisher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onevcat/Kingfisher/merges","archive_url":"https://api.github.com/repos/onevcat/Kingfisher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onevcat/Kingfisher/downloads","issues_url":"https://api.github.com/repos/onevcat/Kingfisher/issues{/number}","pulls_url":"https://api.github.com/repos/onevcat/Kingfisher/pulls{/number}","milestones_url":"https://api.github.com/repos/onevcat/Kingfisher/milestones{/number}","notifications_url":"https://api.github.com/repos/onevcat/Kingfisher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onevcat/Kingfisher/labels{/name}","releases_url":"https://api.github.com/repos/onevcat/Kingfisher/releases{/id}","deployments_url":"https://api.github.com/repos/onevcat/Kingfisher/deployments","created_at":"2015-04-06T14:26:21Z","updated_at":"2017-03-28T01:34:36Z","pushed_at":"2017-03-28T01:46:49Z","git_url":"git://github.com/onevcat/Kingfisher.git","ssh_url":"git@github.com:onevcat/Kingfisher.git","clone_url":"https://github.com/onevcat/Kingfisher.git","svn_url":"https://github.com/onevcat/Kingfisher","homepage":"","size":2482,"stargazers_count":7856,"watchers_count":7856,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":830,"mirror_url":null,"open_issues_count":16,"forks":830,"open_issues":16,"watchers":7856,"default_branch":"master"}},"base":{"label":"onevcat:master","ref":"master","sha":"4e80b0f567bdb912e34b3f246d1b22583fb3ae0b","user":{"login":"onevcat","id":1019875,"avatar_url":"https://avatars3.githubusercontent.com/u/1019875?v=3","gravatar_id":"","url":"https://api.github.com/users/onevcat","html_url":"https://github.com/onevcat","followers_url":"https://api.github.com/users/onevcat/followers","following_url":"https://api.github.com/users/onevcat/following{/other_user}","gists_url":"https://api.github.com/users/onevcat/gists{/gist_id}","starred_url":"https://api.github.com/users/onevcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onevcat/subscriptions","organizations_url":"https://api.github.com/users/onevcat/orgs","repos_url":"https://api.github.com/users/onevcat/repos","events_url":"https://api.github.com/users/onevcat/events{/privacy}","received_events_url":"https://api.github.com/users/onevcat/received_events","type":"User","site_admin":false},"repo":{"id":33486016,"name":"Kingfisher","full_name":"onevcat/Kingfisher","owner":{"login":"onevcat","id":1019875,"avatar_url":"https://avatars3.githubusercontent.com/u/1019875?v=3","gravatar_id":"","url":"https://api.github.com/users/onevcat","html_url":"https://github.com/onevcat","followers_url":"https://api.github.com/users/onevcat/followers","following_url":"https://api.github.com/users/onevcat/following{/other_user}","gists_url":"https://api.github.com/users/onevcat/gists{/gist_id}","starred_url":"https://api.github.com/users/onevcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onevcat/subscriptions","organizations_url":"https://api.github.com/users/onevcat/orgs","repos_url":"https://api.github.com/users/onevcat/repos","events_url":"https://api.github.com/users/onevcat/events{/privacy}","received_events_url":"https://api.github.com/users/onevcat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/onevcat/Kingfisher","description":"A lightweight, pure-Swift library for downloading and caching images from the web.","fork":false,"url":"https://api.github.com/repos/onevcat/Kingfisher","forks_url":"https://api.github.com/repos/onevcat/Kingfisher/forks","keys_url":"https://api.github.com/repos/onevcat/Kingfisher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onevcat/Kingfisher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onevcat/Kingfisher/teams","hooks_url":"https://api.github.com/repos/onevcat/Kingfisher/hooks","issue_events_url":"https://api.github.com/repos/onevcat/Kingfisher/issues/events{/number}","events_url":"https://api.github.com/repos/onevcat/Kingfisher/events","assignees_url":"https://api.github.com/repos/onevcat/Kingfisher/assignees{/user}","branches_url":"https://api.github.com/repos/onevcat/Kingfisher/branches{/branch}","tags_url":"https://api.github.com/repos/onevcat/Kingfisher/tags","blobs_url":"https://api.github.com/repos/onevcat/Kingfisher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onevcat/Kingfisher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onevcat/Kingfisher/git/refs{/sha}","trees_url":"https://api.github.com/repos/onevcat/Kingfisher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onevcat/Kingfisher/statuses/{sha}","languages_url":"https://api.github.com/repos/onevcat/Kingfisher/languages","stargazers_url":"https://api.github.com/repos/onevcat/Kingfisher/stargazers","contributors_url":"https://api.github.com/repos/onevcat/Kingfisher/contributors","subscribers_url":"https://api.github.com/repos/onevcat/Kingfisher/subscribers","subscription_url":"https://api.github.com/repos/onevcat/Kingfisher/subscription","commits_url":"https://api.github.com/repos/onevcat/Kingfisher/commits{/sha}","git_commits_url":"https://api.github.com/repos/onevcat/Kingfisher/git/commits{/sha}","comments_url":"https://api.github.com/repos/onevcat/Kingfisher/comments{/number}","issue_comment_url":"https://api.github.com/repos/onevcat/Kingfisher/issues/comments{/number}","contents_url":"https://api.github.com/repos/onevcat/Kingfisher/contents/{+path}","compare_url":"https://api.github.com/repos/onevcat/Kingfisher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onevcat/Kingfisher/merges","archive_url":"https://api.github.com/repos/onevcat/Kingfisher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onevcat/Kingfisher/downloads","issues_url":"https://api.github.com/repos/onevcat/Kingfisher/issues{/number}","pulls_url":"https://api.github.com/repos/onevcat/Kingfisher/pulls{/number}","milestones_url":"https://api.github.com/repos/onevcat/Kingfisher/milestones{/number}","notifications_url":"https://api.github.com/repos/onevcat/Kingfisher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onevcat/Kingfisher/labels{/name}","releases_url":"https://api.github.com/repos/onevcat/Kingfisher/releases{/id}","deployments_url":"https://api.github.com/repos/onevcat/Kingfisher/deployments","created_at":"2015-04-06T14:26:21Z","updated_at":"2017-03-28T01:34:36Z","pushed_at":"2017-03-28T01:46:49Z","git_url":"git://github.com/onevcat/Kingfisher.git","ssh_url":"git@github.com:onevcat/Kingfisher.git","clone_url":"https://github.com/onevcat/Kingfisher.git","svn_url":"https://github.com/onevcat/Kingfisher","homepage":"","size":2482,"stargazers_count":7856,"watchers_count":7856,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":830,"mirror_url":null,"open_issues_count":16,"forks":830,"open_issues":16,"watchers":7856,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/onevcat/Kingfisher/pulls/630"},"html":{"href":"https://github.com/onevcat/Kingfisher/pull/630"},"issue":{"href":"https://api.github.com/repos/onevcat/Kingfisher/issues/630"},"comments":{"href":"https://api.github.com/repos/onevcat/Kingfisher/issues/630/comments"},"review_comments":{"href":"https://api.github.com/repos/onevcat/Kingfisher/pulls/630/comments"},"review_comment":{"href":"https://api.github.com/repos/onevcat/Kingfisher/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/onevcat/Kingfisher/pulls/630/commits"},"statuses":{"href":"https://api.github.com/repos/onevcat/Kingfisher/statuses/bfd540b49a932e294ab82adb8ec7a543574f22fa"}}}}
{"actor":{"display_login":"onevcat"}}