{"action":"created","comment":{"url":"https://api.github.com/repos/Sonarr/Sonarr/pulls/comments/23788259","id":23788259,"diff_hunk":"@@ -0,0 +1,39 @@\n+﻿using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using ImageResizer;\n+using NzbDrone.Common.Disk;\n+\n+namespace NzbDrone.Core.MediaCover\n+{\n+    public interface IImageResizer\n+    {\n+        void Resize(string source, string destination, int height);\n+    }\n+\n+    public class ImageResizer : IImageResizer\n+    {\n+        private readonly IDiskProvider _diskProvider;\n+\n+        public ImageResizer(IDiskProvider diskProvider)\n+        {\n+            _diskProvider = diskProvider;\n+        }\n+\n+        public void Resize(string source, string destination, int height)\n+        {\n+            using (var stream = _diskProvider.OpenReadStream(source))","path":"src/NzbDrone.Core/MediaCover/ImageResizer.cs","position":25,"original_position":25,"commit_id":"cbb0cc0e85708356566afeac6e474a61b76b136e","original_commit_id":"cbb0cc0e85708356566afeac6e474a61b76b136e","user":{"login":"kayone","id":412280,"avatar_url":"https://avatars.githubusercontent.com/u/412280?v=3","gravatar_id":"","url":"https://api.github.com/users/kayone","html_url":"https://github.com/kayone","followers_url":"https://api.github.com/users/kayone/followers","following_url":"https://api.github.com/users/kayone/following{/other_user}","gists_url":"https://api.github.com/users/kayone/gists{/gist_id}","starred_url":"https://api.github.com/users/kayone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kayone/subscriptions","organizations_url":"https://api.github.com/users/kayone/orgs","repos_url":"https://api.github.com/users/kayone/repos","events_url":"https://api.github.com/users/kayone/events{/privacy}","received_events_url":"https://api.github.com/users/kayone/received_events","type":"User","site_admin":false},"body":"sourceStream","created_at":"2015-01-29T18:06:40Z","updated_at":"2015-01-29T18:06:40Z","html_url":"https://github.com/Sonarr/Sonarr/pull/182#discussion_r23788259","pull_request_url":"https://api.github.com/repos/Sonarr/Sonarr/pulls/182","_links":{"self":{"href":"https://api.github.com/repos/Sonarr/Sonarr/pulls/comments/23788259"},"html":{"href":"https://github.com/Sonarr/Sonarr/pull/182#discussion_r23788259"},"pull_request":{"href":"https://api.github.com/repos/Sonarr/Sonarr/pulls/182"}}},"pull_request":{"url":"https://api.github.com/repos/Sonarr/Sonarr/pulls/182","id":27885251,"html_url":"https://github.com/Sonarr/Sonarr/pull/182","diff_url":"https://github.com/Sonarr/Sonarr/pull/182.diff","patch_url":"https://github.com/Sonarr/Sonarr/pull/182.patch","issue_url":"https://api.github.com/repos/Sonarr/Sonarr/issues/182","number":182,"state":"open","locked":false,"title":"Added support to the api mediacover endpoint to resize the image","user":{"login":"Taloth","id":6383890,"avatar_url":"https://avatars.githubusercontent.com/u/6383890?v=3","gravatar_id":"","url":"https://api.github.com/users/Taloth","html_url":"https://github.com/Taloth","followers_url":"https://api.github.com/users/Taloth/followers","following_url":"https://api.github.com/users/Taloth/following{/other_user}","gists_url":"https://api.github.com/users/Taloth/gists{/gist_id}","starred_url":"https://api.github.com/users/Taloth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Taloth/subscriptions","organizations_url":"https://api.github.com/users/Taloth/orgs","repos_url":"https://api.github.com/users/Taloth/repos","events_url":"https://api.github.com/users/Taloth/events{/privacy}","received_events_url":"https://api.github.com/users/Taloth/received_events","type":"User","site_admin":false},"body":"Didn't do caching, but the thirdparty app should do that anyway. Using the ImageResizer library to do the heavy lifting.\r\n\r\nYou can specify ```&width=``` and/or ```&height=``` if you do both it you can additionally specify ```&mode=Max|Pad|Crop|Carve|Stretch``` (defaults to Crop).\r\nI would recommend Max or Crop, which preserve aspect ratio.\r\n\r\n","created_at":"2015-01-22T22:41:08Z","updated_at":"2015-01-29T18:06:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"257d143e83c948c733370d6f0faaa13d6c247b24","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Sonarr/Sonarr/pulls/182/commits","review_comments_url":"https://api.github.com/repos/Sonarr/Sonarr/pulls/182/comments","review_comment_url":"https://api.github.com/repos/Sonarr/Sonarr/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Sonarr/Sonarr/issues/182/comments","statuses_url":"https://api.github.com/repos/Sonarr/Sonarr/statuses/cbb0cc0e85708356566afeac6e474a61b76b136e","head":{"label":"Sonarr:image-resize","ref":"image-resize","sha":"cbb0cc0e85708356566afeac6e474a61b76b136e","user":{"login":"Sonarr","id":1082903,"avatar_url":"https://avatars.githubusercontent.com/u/1082903?v=3","gravatar_id":"","url":"https://api.github.com/users/Sonarr","html_url":"https://github.com/Sonarr","followers_url":"https://api.github.com/users/Sonarr/followers","following_url":"https://api.github.com/users/Sonarr/following{/other_user}","gists_url":"https://api.github.com/users/Sonarr/gists{/gist_id}","starred_url":"https://api.github.com/users/Sonarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sonarr/subscriptions","organizations_url":"https://api.github.com/users/Sonarr/orgs","repos_url":"https://api.github.com/users/Sonarr/repos","events_url":"https://api.github.com/users/Sonarr/events{/privacy}","received_events_url":"https://api.github.com/users/Sonarr/received_events","type":"Organization","site_admin":false},"repo":{"id":2465723,"name":"Sonarr","full_name":"Sonarr/Sonarr","owner":{"login":"Sonarr","id":1082903,"avatar_url":"https://avatars.githubusercontent.com/u/1082903?v=3","gravatar_id":"","url":"https://api.github.com/users/Sonarr","html_url":"https://github.com/Sonarr","followers_url":"https://api.github.com/users/Sonarr/followers","following_url":"https://api.github.com/users/Sonarr/following{/other_user}","gists_url":"https://api.github.com/users/Sonarr/gists{/gist_id}","starred_url":"https://api.github.com/users/Sonarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sonarr/subscriptions","organizations_url":"https://api.github.com/users/Sonarr/orgs","repos_url":"https://api.github.com/users/Sonarr/repos","events_url":"https://api.github.com/users/Sonarr/events{/privacy}","received_events_url":"https://api.github.com/users/Sonarr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Sonarr/Sonarr","description":"Smart PVR for newsgroup and bittorrent users.","fork":false,"url":"https://api.github.com/repos/Sonarr/Sonarr","forks_url":"https://api.github.com/repos/Sonarr/Sonarr/forks","keys_url":"https://api.github.com/repos/Sonarr/Sonarr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sonarr/Sonarr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sonarr/Sonarr/teams","hooks_url":"https://api.github.com/repos/Sonarr/Sonarr/hooks","issue_events_url":"https://api.github.com/repos/Sonarr/Sonarr/issues/events{/number}","events_url":"https://api.github.com/repos/Sonarr/Sonarr/events","assignees_url":"https://api.github.com/repos/Sonarr/Sonarr/assignees{/user}","branches_url":"https://api.github.com/repos/Sonarr/Sonarr/branches{/branch}","tags_url":"https://api.github.com/repos/Sonarr/Sonarr/tags","blobs_url":"https://api.github.com/repos/Sonarr/Sonarr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sonarr/Sonarr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sonarr/Sonarr/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sonarr/Sonarr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sonarr/Sonarr/statuses/{sha}","languages_url":"https://api.github.com/repos/Sonarr/Sonarr/languages","stargazers_url":"https://api.github.com/repos/Sonarr/Sonarr/stargazers","contributors_url":"https://api.github.com/repos/Sonarr/Sonarr/contributors","subscribers_url":"https://api.github.com/repos/Sonarr/Sonarr/subscribers","subscription_url":"https://api.github.com/repos/Sonarr/Sonarr/subscription","commits_url":"https://api.github.com/repos/Sonarr/Sonarr/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sonarr/Sonarr/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sonarr/Sonarr/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sonarr/Sonarr/issues/comments/{number}","contents_url":"https://api.github.com/repos/Sonarr/Sonarr/contents/{+path}","compare_url":"https://api.github.com/repos/Sonarr/Sonarr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sonarr/Sonarr/merges","archive_url":"https://api.github.com/repos/Sonarr/Sonarr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sonarr/Sonarr/downloads","issues_url":"https://api.github.com/repos/Sonarr/Sonarr/issues{/number}","pulls_url":"https://api.github.com/repos/Sonarr/Sonarr/pulls{/number}","milestones_url":"https://api.github.com/repos/Sonarr/Sonarr/milestones{/number}","notifications_url":"https://api.github.com/repos/Sonarr/Sonarr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sonarr/Sonarr/labels{/name}","releases_url":"https://api.github.com/repos/Sonarr/Sonarr/releases{/id}","created_at":"2011-09-27T05:57:16Z","updated_at":"2015-01-29T15:22:51Z","pushed_at":"2015-01-28T22:21:45Z","git_url":"git://github.com/Sonarr/Sonarr.git","ssh_url":"git@github.com:Sonarr/Sonarr.git","clone_url":"https://github.com/Sonarr/Sonarr.git","svn_url":"https://github.com/Sonarr/Sonarr","homepage":"https://sonarr.tv","size":211734,"stargazers_count":371,"watchers_count":371,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":110,"mirror_url":null,"open_issues_count":10,"forks":110,"open_issues":10,"watchers":371,"default_branch":"develop"}},"base":{"label":"Sonarr:develop","ref":"develop","sha":"b1871c1686d2e43e09e150f3ef56270ac17ecba6","user":{"login":"Sonarr","id":1082903,"avatar_url":"https://avatars.githubusercontent.com/u/1082903?v=3","gravatar_id":"","url":"https://api.github.com/users/Sonarr","html_url":"https://github.com/Sonarr","followers_url":"https://api.github.com/users/Sonarr/followers","following_url":"https://api.github.com/users/Sonarr/following{/other_user}","gists_url":"https://api.github.com/users/Sonarr/gists{/gist_id}","starred_url":"https://api.github.com/users/Sonarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sonarr/subscriptions","organizations_url":"https://api.github.com/users/Sonarr/orgs","repos_url":"https://api.github.com/users/Sonarr/repos","events_url":"https://api.github.com/users/Sonarr/events{/privacy}","received_events_url":"https://api.github.com/users/Sonarr/received_events","type":"Organization","site_admin":false},"repo":{"id":2465723,"name":"Sonarr","full_name":"Sonarr/Sonarr","owner":{"login":"Sonarr","id":1082903,"avatar_url":"https://avatars.githubusercontent.com/u/1082903?v=3","gravatar_id":"","url":"https://api.github.com/users/Sonarr","html_url":"https://github.com/Sonarr","followers_url":"https://api.github.com/users/Sonarr/followers","following_url":"https://api.github.com/users/Sonarr/following{/other_user}","gists_url":"https://api.github.com/users/Sonarr/gists{/gist_id}","starred_url":"https://api.github.com/users/Sonarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sonarr/subscriptions","organizations_url":"https://api.github.com/users/Sonarr/orgs","repos_url":"https://api.github.com/users/Sonarr/repos","events_url":"https://api.github.com/users/Sonarr/events{/privacy}","received_events_url":"https://api.github.com/users/Sonarr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Sonarr/Sonarr","description":"Smart PVR for newsgroup and bittorrent users.","fork":false,"url":"https://api.github.com/repos/Sonarr/Sonarr","forks_url":"https://api.github.com/repos/Sonarr/Sonarr/forks","keys_url":"https://api.github.com/repos/Sonarr/Sonarr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sonarr/Sonarr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sonarr/Sonarr/teams","hooks_url":"https://api.github.com/repos/Sonarr/Sonarr/hooks","issue_events_url":"https://api.github.com/repos/Sonarr/Sonarr/issues/events{/number}","events_url":"https://api.github.com/repos/Sonarr/Sonarr/events","assignees_url":"https://api.github.com/repos/Sonarr/Sonarr/assignees{/user}","branches_url":"https://api.github.com/repos/Sonarr/Sonarr/branches{/branch}","tags_url":"https://api.github.com/repos/Sonarr/Sonarr/tags","blobs_url":"https://api.github.com/repos/Sonarr/Sonarr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sonarr/Sonarr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sonarr/Sonarr/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sonarr/Sonarr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sonarr/Sonarr/statuses/{sha}","languages_url":"https://api.github.com/repos/Sonarr/Sonarr/languages","stargazers_url":"https://api.github.com/repos/Sonarr/Sonarr/stargazers","contributors_url":"https://api.github.com/repos/Sonarr/Sonarr/contributors","subscribers_url":"https://api.github.com/repos/Sonarr/Sonarr/subscribers","subscription_url":"https://api.github.com/repos/Sonarr/Sonarr/subscription","commits_url":"https://api.github.com/repos/Sonarr/Sonarr/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sonarr/Sonarr/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sonarr/Sonarr/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sonarr/Sonarr/issues/comments/{number}","contents_url":"https://api.github.com/repos/Sonarr/Sonarr/contents/{+path}","compare_url":"https://api.github.com/repos/Sonarr/Sonarr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sonarr/Sonarr/merges","archive_url":"https://api.github.com/repos/Sonarr/Sonarr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sonarr/Sonarr/downloads","issues_url":"https://api.github.com/repos/Sonarr/Sonarr/issues{/number}","pulls_url":"https://api.github.com/repos/Sonarr/Sonarr/pulls{/number}","milestones_url":"https://api.github.com/repos/Sonarr/Sonarr/milestones{/number}","notifications_url":"https://api.github.com/repos/Sonarr/Sonarr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sonarr/Sonarr/labels{/name}","releases_url":"https://api.github.com/repos/Sonarr/Sonarr/releases{/id}","created_at":"2011-09-27T05:57:16Z","updated_at":"2015-01-29T15:22:51Z","pushed_at":"2015-01-28T22:21:45Z","git_url":"git://github.com/Sonarr/Sonarr.git","ssh_url":"git@github.com:Sonarr/Sonarr.git","clone_url":"https://github.com/Sonarr/Sonarr.git","svn_url":"https://github.com/Sonarr/Sonarr","homepage":"https://sonarr.tv","size":211734,"stargazers_count":371,"watchers_count":371,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":110,"mirror_url":null,"open_issues_count":10,"forks":110,"open_issues":10,"watchers":371,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Sonarr/Sonarr/pulls/182"},"html":{"href":"https://github.com/Sonarr/Sonarr/pull/182"},"issue":{"href":"https://api.github.com/repos/Sonarr/Sonarr/issues/182"},"comments":{"href":"https://api.github.com/repos/Sonarr/Sonarr/issues/182/comments"},"review_comments":{"href":"https://api.github.com/repos/Sonarr/Sonarr/pulls/182/comments"},"review_comment":{"href":"https://api.github.com/repos/Sonarr/Sonarr/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Sonarr/Sonarr/pulls/182/commits"},"statuses":{"href":"https://api.github.com/repos/Sonarr/Sonarr/statuses/cbb0cc0e85708356566afeac6e474a61b76b136e"}}}}