{"action":"created","comment":{"url":"https://api.github.com/repos/h2non/imaginary/pulls/comments/205187240","pull_request_review_id":140408235,"id":205187240,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTE4NzI0MA==","diff_hunk":"@@ -101,22 +101,44 @@ func Fit(buf []byte, o ImageOptions) (Image, error) {\n \t\treturn Image{}, NewError(\"Missing required params: height, width\", BadRequest)\n \t}\n \n-\tdims, err := bimg.Size(buf)\n+\tmetadata, err := bimg.Metadata(buf)\n \tif err != nil {\n \t\treturn Image{}, err\n \t}\n \n-\t// if input ratio > output ratio\n+\tdims := metadata.Size\n+\n+\t// metadata.Orientation","path":"image.go","position":null,"original_position":13,"commit_id":"86f75f34041b6248935e0e34e911526a6a700f29","original_commit_id":"95d508612ac0fa955cd5849afd8f2b2fe0e2ee34","user":{"login":"yuecelm","id":12153500,"node_id":"MDQ6VXNlcjEyMTUzNTAw","avatar_url":"https://avatars3.githubusercontent.com/u/12153500?v=4","gravatar_id":"","url":"https://api.github.com/users/yuecelm","html_url":"https://github.com/yuecelm","followers_url":"https://api.github.com/users/yuecelm/followers","following_url":"https://api.github.com/users/yuecelm/following{/other_user}","gists_url":"https://api.github.com/users/yuecelm/gists{/gist_id}","starred_url":"https://api.github.com/users/yuecelm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuecelm/subscriptions","organizations_url":"https://api.github.com/users/yuecelm/orgs","repos_url":"https://api.github.com/users/yuecelm/repos","events_url":"https://api.github.com/users/yuecelm/events{/privacy}","received_events_url":"https://api.github.com/users/yuecelm/received_events","type":"User","site_admin":false},"body":"I think in order to understand the code, you need to know all values of metadata.Orientation. Using a constant instead of 4 will not make the code better understandable without any comments.","created_at":"2018-07-25T17:01:01Z","updated_at":"2018-07-25T17:01:02Z","html_url":"https://github.com/h2non/imaginary/pull/208#discussion_r205187240","pull_request_url":"https://api.github.com/repos/h2non/imaginary/pulls/208","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/h2non/imaginary/pulls/comments/205187240"},"html":{"href":"https://github.com/h2non/imaginary/pull/208#discussion_r205187240"},"pull_request":{"href":"https://api.github.com/repos/h2non/imaginary/pulls/208"}},"in_reply_to_id":204044358},"pull_request":{"url":"https://api.github.com/repos/h2non/imaginary/pulls/208","id":199705211,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NzA1MjEx","html_url":"https://github.com/h2non/imaginary/pull/208","diff_url":"https://github.com/h2non/imaginary/pull/208.diff","patch_url":"https://github.com/h2non/imaginary/pull/208.patch","issue_url":"https://api.github.com/repos/h2non/imaginary/issues/208","number":208,"state":"open","locked":false,"title":"fix fit for autorotated JPEG images in landscape orientation","user":{"login":"yuecelm","id":12153500,"node_id":"MDQ6VXNlcjEyMTUzNTAw","avatar_url":"https://avatars3.githubusercontent.com/u/12153500?v=4","gravatar_id":"","url":"https://api.github.com/users/yuecelm","html_url":"https://github.com/yuecelm","followers_url":"https://api.github.com/users/yuecelm/followers","following_url":"https://api.github.com/users/yuecelm/following{/other_user}","gists_url":"https://api.github.com/users/yuecelm/gists{/gist_id}","starred_url":"https://api.github.com/users/yuecelm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuecelm/subscriptions","organizations_url":"https://api.github.com/users/yuecelm/orgs","repos_url":"https://api.github.com/users/yuecelm/repos","events_url":"https://api.github.com/users/yuecelm/events{/privacy}","received_events_url":"https://api.github.com/users/yuecelm/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-06T10:18:19Z","updated_at":"2018-07-25T17:01:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d511b8026a251774be8379605879ddc909dc8ea2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/h2non/imaginary/pulls/208/commits","review_comments_url":"https://api.github.com/repos/h2non/imaginary/pulls/208/comments","review_comment_url":"https://api.github.com/repos/h2non/imaginary/pulls/comments{/number}","comments_url":"https://api.github.com/repos/h2non/imaginary/issues/208/comments","statuses_url":"https://api.github.com/repos/h2non/imaginary/statuses/86f75f34041b6248935e0e34e911526a6a700f29","head":{"label":"yuecelm:yum/fix-fit","ref":"yum/fix-fit","sha":"86f75f34041b6248935e0e34e911526a6a700f29","user":{"login":"yuecelm","id":12153500,"node_id":"MDQ6VXNlcjEyMTUzNTAw","avatar_url":"https://avatars3.githubusercontent.com/u/12153500?v=4","gravatar_id":"","url":"https://api.github.com/users/yuecelm","html_url":"https://github.com/yuecelm","followers_url":"https://api.github.com/users/yuecelm/followers","following_url":"https://api.github.com/users/yuecelm/following{/other_user}","gists_url":"https://api.github.com/users/yuecelm/gists{/gist_id}","starred_url":"https://api.github.com/users/yuecelm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuecelm/subscriptions","organizations_url":"https://api.github.com/users/yuecelm/orgs","repos_url":"https://api.github.com/users/yuecelm/repos","events_url":"https://api.github.com/users/yuecelm/events{/privacy}","received_events_url":"https://api.github.com/users/yuecelm/received_events","type":"User","site_admin":false},"repo":{"id":139182260,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkxODIyNjA=","name":"imaginary","full_name":"yuecelm/imaginary","owner":{"login":"yuecelm","id":12153500,"node_id":"MDQ6VXNlcjEyMTUzNTAw","avatar_url":"https://avatars3.githubusercontent.com/u/12153500?v=4","gravatar_id":"","url":"https://api.github.com/users/yuecelm","html_url":"https://github.com/yuecelm","followers_url":"https://api.github.com/users/yuecelm/followers","following_url":"https://api.github.com/users/yuecelm/following{/other_user}","gists_url":"https://api.github.com/users/yuecelm/gists{/gist_id}","starred_url":"https://api.github.com/users/yuecelm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuecelm/subscriptions","organizations_url":"https://api.github.com/users/yuecelm/orgs","repos_url":"https://api.github.com/users/yuecelm/repos","events_url":"https://api.github.com/users/yuecelm/events{/privacy}","received_events_url":"https://api.github.com/users/yuecelm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yuecelm/imaginary","description":"Fast, simple, scalable HTTP microservice for high-level image processing with first-class Docker support","fork":true,"url":"https://api.github.com/repos/yuecelm/imaginary","forks_url":"https://api.github.com/repos/yuecelm/imaginary/forks","keys_url":"https://api.github.com/repos/yuecelm/imaginary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yuecelm/imaginary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yuecelm/imaginary/teams","hooks_url":"https://api.github.com/repos/yuecelm/imaginary/hooks","issue_events_url":"https://api.github.com/repos/yuecelm/imaginary/issues/events{/number}","events_url":"https://api.github.com/repos/yuecelm/imaginary/events","assignees_url":"https://api.github.com/repos/yuecelm/imaginary/assignees{/user}","branches_url":"https://api.github.com/repos/yuecelm/imaginary/branches{/branch}","tags_url":"https://api.github.com/repos/yuecelm/imaginary/tags","blobs_url":"https://api.github.com/repos/yuecelm/imaginary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yuecelm/imaginary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yuecelm/imaginary/git/refs{/sha}","trees_url":"https://api.github.com/repos/yuecelm/imaginary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yuecelm/imaginary/statuses/{sha}","languages_url":"https://api.github.com/repos/yuecelm/imaginary/languages","stargazers_url":"https://api.github.com/repos/yuecelm/imaginary/stargazers","contributors_url":"https://api.github.com/repos/yuecelm/imaginary/contributors","subscribers_url":"https://api.github.com/repos/yuecelm/imaginary/subscribers","subscription_url":"https://api.github.com/repos/yuecelm/imaginary/subscription","commits_url":"https://api.github.com/repos/yuecelm/imaginary/commits{/sha}","git_commits_url":"https://api.github.com/repos/yuecelm/imaginary/git/commits{/sha}","comments_url":"https://api.github.com/repos/yuecelm/imaginary/comments{/number}","issue_comment_url":"https://api.github.com/repos/yuecelm/imaginary/issues/comments{/number}","contents_url":"https://api.github.com/repos/yuecelm/imaginary/contents/{+path}","compare_url":"https://api.github.com/repos/yuecelm/imaginary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yuecelm/imaginary/merges","archive_url":"https://api.github.com/repos/yuecelm/imaginary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yuecelm/imaginary/downloads","issues_url":"https://api.github.com/repos/yuecelm/imaginary/issues{/number}","pulls_url":"https://api.github.com/repos/yuecelm/imaginary/pulls{/number}","milestones_url":"https://api.github.com/repos/yuecelm/imaginary/milestones{/number}","notifications_url":"https://api.github.com/repos/yuecelm/imaginary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yuecelm/imaginary/labels{/name}","releases_url":"https://api.github.com/repos/yuecelm/imaginary/releases{/id}","deployments_url":"https://api.github.com/repos/yuecelm/imaginary/deployments","created_at":"2018-06-29T18:22:05Z","updated_at":"2018-07-06T18:39:11Z","pushed_at":"2018-07-25T16:53:00Z","git_url":"git://github.com/yuecelm/imaginary.git","ssh_url":"git@github.com:yuecelm/imaginary.git","clone_url":"https://github.com/yuecelm/imaginary.git","svn_url":"https://github.com/yuecelm/imaginary","homepage":"","size":18355,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"h2non:master","ref":"master","sha":"2a17cdf184f3a88fb049df5b9393f6ec19e71cde","user":{"login":"h2non","id":63402,"node_id":"MDQ6VXNlcjYzNDAy","avatar_url":"https://avatars0.githubusercontent.com/u/63402?v=4","gravatar_id":"","url":"https://api.github.com/users/h2non","html_url":"https://github.com/h2non","followers_url":"https://api.github.com/users/h2non/followers","following_url":"https://api.github.com/users/h2non/following{/other_user}","gists_url":"https://api.github.com/users/h2non/gists{/gist_id}","starred_url":"https://api.github.com/users/h2non/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h2non/subscriptions","organizations_url":"https://api.github.com/users/h2non/orgs","repos_url":"https://api.github.com/users/h2non/repos","events_url":"https://api.github.com/users/h2non/events{/privacy}","received_events_url":"https://api.github.com/users/h2non/received_events","type":"User","site_admin":false},"repo":{"id":31673858,"node_id":"MDEwOlJlcG9zaXRvcnkzMTY3Mzg1OA==","name":"imaginary","full_name":"h2non/imaginary","owner":{"login":"h2non","id":63402,"node_id":"MDQ6VXNlcjYzNDAy","avatar_url":"https://avatars0.githubusercontent.com/u/63402?v=4","gravatar_id":"","url":"https://api.github.com/users/h2non","html_url":"https://github.com/h2non","followers_url":"https://api.github.com/users/h2non/followers","following_url":"https://api.github.com/users/h2non/following{/other_user}","gists_url":"https://api.github.com/users/h2non/gists{/gist_id}","starred_url":"https://api.github.com/users/h2non/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h2non/subscriptions","organizations_url":"https://api.github.com/users/h2non/orgs","repos_url":"https://api.github.com/users/h2non/repos","events_url":"https://api.github.com/users/h2non/events{/privacy}","received_events_url":"https://api.github.com/users/h2non/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/h2non/imaginary","description":"Fast, simple, scalable HTTP microservice for high-level image processing with first-class Docker support","fork":false,"url":"https://api.github.com/repos/h2non/imaginary","forks_url":"https://api.github.com/repos/h2non/imaginary/forks","keys_url":"https://api.github.com/repos/h2non/imaginary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/h2non/imaginary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/h2non/imaginary/teams","hooks_url":"https://api.github.com/repos/h2non/imaginary/hooks","issue_events_url":"https://api.github.com/repos/h2non/imaginary/issues/events{/number}","events_url":"https://api.github.com/repos/h2non/imaginary/events","assignees_url":"https://api.github.com/repos/h2non/imaginary/assignees{/user}","branches_url":"https://api.github.com/repos/h2non/imaginary/branches{/branch}","tags_url":"https://api.github.com/repos/h2non/imaginary/tags","blobs_url":"https://api.github.com/repos/h2non/imaginary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/h2non/imaginary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/h2non/imaginary/git/refs{/sha}","trees_url":"https://api.github.com/repos/h2non/imaginary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/h2non/imaginary/statuses/{sha}","languages_url":"https://api.github.com/repos/h2non/imaginary/languages","stargazers_url":"https://api.github.com/repos/h2non/imaginary/stargazers","contributors_url":"https://api.github.com/repos/h2non/imaginary/contributors","subscribers_url":"https://api.github.com/repos/h2non/imaginary/subscribers","subscription_url":"https://api.github.com/repos/h2non/imaginary/subscription","commits_url":"https://api.github.com/repos/h2non/imaginary/commits{/sha}","git_commits_url":"https://api.github.com/repos/h2non/imaginary/git/commits{/sha}","comments_url":"https://api.github.com/repos/h2non/imaginary/comments{/number}","issue_comment_url":"https://api.github.com/repos/h2non/imaginary/issues/comments{/number}","contents_url":"https://api.github.com/repos/h2non/imaginary/contents/{+path}","compare_url":"https://api.github.com/repos/h2non/imaginary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/h2non/imaginary/merges","archive_url":"https://api.github.com/repos/h2non/imaginary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/h2non/imaginary/downloads","issues_url":"https://api.github.com/repos/h2non/imaginary/issues{/number}","pulls_url":"https://api.github.com/repos/h2non/imaginary/pulls{/number}","milestones_url":"https://api.github.com/repos/h2non/imaginary/milestones{/number}","notifications_url":"https://api.github.com/repos/h2non/imaginary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/h2non/imaginary/labels{/name}","releases_url":"https://api.github.com/repos/h2non/imaginary/releases{/id}","deployments_url":"https://api.github.com/repos/h2non/imaginary/deployments","created_at":"2015-03-04T18:51:40Z","updated_at":"2018-07-25T16:03:26Z","pushed_at":"2018-07-25T16:53:02Z","git_url":"git://github.com/h2non/imaginary.git","ssh_url":"git@github.com:h2non/imaginary.git","clone_url":"https://github.com/h2non/imaginary.git","svn_url":"https://github.com/h2non/imaginary","homepage":"","size":18255,"stargazers_count":1867,"watchers_count":1867,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":187,"mirror_url":null,"archived":false,"open_issues_count":44,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":187,"open_issues":44,"watchers":1867,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/h2non/imaginary/pulls/208"},"html":{"href":"https://github.com/h2non/imaginary/pull/208"},"issue":{"href":"https://api.github.com/repos/h2non/imaginary/issues/208"},"comments":{"href":"https://api.github.com/repos/h2non/imaginary/issues/208/comments"},"review_comments":{"href":"https://api.github.com/repos/h2non/imaginary/pulls/208/comments"},"review_comment":{"href":"https://api.github.com/repos/h2non/imaginary/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/h2non/imaginary/pulls/208/commits"},"statuses":{"href":"https://api.github.com/repos/h2non/imaginary/statuses/86f75f34041b6248935e0e34e911526a6a700f29"}},"author_association":"NONE"}}
{"actor":{"display_login":"yuecelm"}}