{"action":"created","comment":{"url":"https://api.github.com/repos/humanmade/tachyon/pulls/comments/204331809","pull_request_review_id":139390319,"id":204331809,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDMzMTgwOQ==","diff_hunk":"@@ -155,27 +159,36 @@ module.exports.resizeBuffer = function(buffer, args, callback) {\n \t\t\t\t\t\timage.embed();\n \t\t\t\t\t} else if (args.w || args.h) {\n \t\t\t\t\t\timage.resize(\n-\t\t\t\t\t\t\tNumber(args.w) || null,\n-\t\t\t\t\t\t\tNumber(args.h) || null\n+\t\t\t\t\t\t\t(Number(args.w) * zoom) || null,\n+\t\t\t\t\t\t\t(Number(args.h) * zoom) || null\n \t\t\t\t\t\t);\n \t\t\t\t\t\tif (!args.crop) {\n \t\t\t\t\t\t\timage.max();\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \n+\t\t\t\t\t// return a default compression value based on a logarithmic scale\n+\t\t\t\t\t// defaultValue = 100, zoom = 2; = 65\n+\t\t\t\t\t// defaultValue = 80, zoom = 2; = 50\n+\t\t\t\t\t// defaultValue = 100, zoom = 1.5; = 86\n+\t\t\t\t\t// defaultValue = 80, zoom = 1.5; = 68\n+\t\t\t\t\tvar applyZoomCompression = function( defaultValue, zoom ) {\n+\t\t\t\t\t\treturn Math.min(Math.max(Math.round( defaultValue - ( (Math.log(zoom) / Math.log(defaultValue / zoom)) * (defaultValue * zoom) ) ), Math.round(defaultValue / zoom)), defaultValue);","path":"index.js","position":65,"original_position":65,"commit_id":"c2b84630c43079a38a7968725fd2923e3757a681","original_commit_id":"c2b84630c43079a38a7968725fd2923e3757a681","user":{"login":"roborourke","id":23417,"node_id":"MDQ6VXNlcjIzNDE3","avatar_url":"https://avatars1.githubusercontent.com/u/23417?v=4","gravatar_id":"","url":"https://api.github.com/users/roborourke","html_url":"https://github.com/roborourke","followers_url":"https://api.github.com/users/roborourke/followers","following_url":"https://api.github.com/users/roborourke/following{/other_user}","gists_url":"https://api.github.com/users/roborourke/gists{/gist_id}","starred_url":"https://api.github.com/users/roborourke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roborourke/subscriptions","organizations_url":"https://api.github.com/users/roborourke/orgs","repos_url":"https://api.github.com/users/roborourke/repos","events_url":"https://api.github.com/users/roborourke/events{/privacy}","received_events_url":"https://api.github.com/users/roborourke/received_events","type":"User","site_admin":false},"body":"Good idea. The whole codebase needs a good tidy up really!","created_at":"2018-07-23T09:11:32Z","updated_at":"2018-07-23T09:11:33Z","html_url":"https://github.com/humanmade/tachyon/pull/57#discussion_r204331809","pull_request_url":"https://api.github.com/repos/humanmade/tachyon/pulls/57","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/humanmade/tachyon/pulls/comments/204331809"},"html":{"href":"https://github.com/humanmade/tachyon/pull/57#discussion_r204331809"},"pull_request":{"href":"https://api.github.com/repos/humanmade/tachyon/pulls/57"}},"in_reply_to_id":204273817},"pull_request":{"url":"https://api.github.com/repos/humanmade/tachyon/pulls/57","id":202811121,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyODExMTIx","html_url":"https://github.com/humanmade/tachyon/pull/57","diff_url":"https://github.com/humanmade/tachyon/pull/57.diff","patch_url":"https://github.com/humanmade/tachyon/pull/57.patch","issue_url":"https://api.github.com/repos/humanmade/tachyon/issues/57","number":57,"state":"open","locked":false,"title":"Zoom param support","user":{"login":"roborourke","id":23417,"node_id":"MDQ6VXNlcjIzNDE3","avatar_url":"https://avatars1.githubusercontent.com/u/23417?v=4","gravatar_id":"","url":"https://api.github.com/users/roborourke","html_url":"https://github.com/roborourke","followers_url":"https://api.github.com/users/roborourke/followers","following_url":"https://api.github.com/users/roborourke/following{/other_user}","gists_url":"https://api.github.com/users/roborourke/gists{/gist_id}","starred_url":"https://api.github.com/users/roborourke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roborourke/subscriptions","organizations_url":"https://api.github.com/users/roborourke/orgs","repos_url":"https://api.github.com/users/roborourke/repos","events_url":"https://api.github.com/users/roborourke/events{/privacy}","received_events_url":"https://api.github.com/users/roborourke/received_events","type":"User","site_admin":false},"body":"- Sets the default quality to 82% (same as WP)\r\n- Adds default quality compression based on zoom to reduce file sizes if no quality arg set\r\n\r\nFixes #56 ","created_at":"2018-07-20T10:37:06Z","updated_at":"2018-07-23T09:11:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a22f96028a0ae6d0792cad7f6926e38fe00fef5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":325449892,"node_id":"MDU6TGFiZWwzMjU0NDk4OTI=","url":"https://api.github.com/repos/humanmade/tachyon/labels/Enhancement","name":"Enhancement","color":"0e8a16","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/humanmade/tachyon/pulls/57/commits","review_comments_url":"https://api.github.com/repos/humanmade/tachyon/pulls/57/comments","review_comment_url":"https://api.github.com/repos/humanmade/tachyon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/humanmade/tachyon/issues/57/comments","statuses_url":"https://api.github.com/repos/humanmade/tachyon/statuses/c2b84630c43079a38a7968725fd2923e3757a681","head":{"label":"humanmade:zoom","ref":"zoom","sha":"c2b84630c43079a38a7968725fd2923e3757a681","user":{"login":"humanmade","id":644666,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NDY2Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/644666?v=4","gravatar_id":"","url":"https://api.github.com/users/humanmade","html_url":"https://github.com/humanmade","followers_url":"https://api.github.com/users/humanmade/followers","following_url":"https://api.github.com/users/humanmade/following{/other_user}","gists_url":"https://api.github.com/users/humanmade/gists{/gist_id}","starred_url":"https://api.github.com/users/humanmade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humanmade/subscriptions","organizations_url":"https://api.github.com/users/humanmade/orgs","repos_url":"https://api.github.com/users/humanmade/repos","events_url":"https://api.github.com/users/humanmade/events{/privacy}","received_events_url":"https://api.github.com/users/humanmade/received_events","type":"Organization","site_admin":false},"repo":{"id":51627815,"node_id":"MDEwOlJlcG9zaXRvcnk1MTYyNzgxNQ==","name":"tachyon","full_name":"humanmade/tachyon","owner":{"login":"humanmade","id":644666,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NDY2Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/644666?v=4","gravatar_id":"","url":"https://api.github.com/users/humanmade","html_url":"https://github.com/humanmade","followers_url":"https://api.github.com/users/humanmade/followers","following_url":"https://api.github.com/users/humanmade/following{/other_user}","gists_url":"https://api.github.com/users/humanmade/gists{/gist_id}","starred_url":"https://api.github.com/users/humanmade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humanmade/subscriptions","organizations_url":"https://api.github.com/users/humanmade/orgs","repos_url":"https://api.github.com/users/humanmade/repos","events_url":"https://api.github.com/users/humanmade/events{/privacy}","received_events_url":"https://api.github.com/users/humanmade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/humanmade/tachyon","description":" Faster than light image resizing service that runs on AWS. Super simple to set up, highly available and very performant. ","fork":false,"url":"https://api.github.com/repos/humanmade/tachyon","forks_url":"https://api.github.com/repos/humanmade/tachyon/forks","keys_url":"https://api.github.com/repos/humanmade/tachyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/humanmade/tachyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/humanmade/tachyon/teams","hooks_url":"https://api.github.com/repos/humanmade/tachyon/hooks","issue_events_url":"https://api.github.com/repos/humanmade/tachyon/issues/events{/number}","events_url":"https://api.github.com/repos/humanmade/tachyon/events","assignees_url":"https://api.github.com/repos/humanmade/tachyon/assignees{/user}","branches_url":"https://api.github.com/repos/humanmade/tachyon/branches{/branch}","tags_url":"https://api.github.com/repos/humanmade/tachyon/tags","blobs_url":"https://api.github.com/repos/humanmade/tachyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/humanmade/tachyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/humanmade/tachyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/humanmade/tachyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/humanmade/tachyon/statuses/{sha}","languages_url":"https://api.github.com/repos/humanmade/tachyon/languages","stargazers_url":"https://api.github.com/repos/humanmade/tachyon/stargazers","contributors_url":"https://api.github.com/repos/humanmade/tachyon/contributors","subscribers_url":"https://api.github.com/repos/humanmade/tachyon/subscribers","subscription_url":"https://api.github.com/repos/humanmade/tachyon/subscription","commits_url":"https://api.github.com/repos/humanmade/tachyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/humanmade/tachyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/humanmade/tachyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/humanmade/tachyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/humanmade/tachyon/contents/{+path}","compare_url":"https://api.github.com/repos/humanmade/tachyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/humanmade/tachyon/merges","archive_url":"https://api.github.com/repos/humanmade/tachyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/humanmade/tachyon/downloads","issues_url":"https://api.github.com/repos/humanmade/tachyon/issues{/number}","pulls_url":"https://api.github.com/repos/humanmade/tachyon/pulls{/number}","milestones_url":"https://api.github.com/repos/humanmade/tachyon/milestones{/number}","notifications_url":"https://api.github.com/repos/humanmade/tachyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/humanmade/tachyon/labels{/name}","releases_url":"https://api.github.com/repos/humanmade/tachyon/releases{/id}","deployments_url":"https://api.github.com/repos/humanmade/tachyon/deployments","created_at":"2016-02-13T01:58:57Z","updated_at":"2018-07-21T09:26:42Z","pushed_at":"2018-07-20T11:10:53Z","git_url":"git://github.com/humanmade/tachyon.git","ssh_url":"git@github.com:humanmade/tachyon.git","clone_url":"https://github.com/humanmade/tachyon.git","svn_url":"https://github.com/humanmade/tachyon","homepage":"https://engineering.hmn.md/projects/tachyon/","size":3167,"stargazers_count":78,"watchers_count":78,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":7,"license":null,"forks":13,"open_issues":7,"watchers":78,"default_branch":"master"}},"base":{"label":"humanmade:master","ref":"master","sha":"90c079baf7e3b98d06677cf8f8da79804eb0a412","user":{"login":"humanmade","id":644666,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NDY2Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/644666?v=4","gravatar_id":"","url":"https://api.github.com/users/humanmade","html_url":"https://github.com/humanmade","followers_url":"https://api.github.com/users/humanmade/followers","following_url":"https://api.github.com/users/humanmade/following{/other_user}","gists_url":"https://api.github.com/users/humanmade/gists{/gist_id}","starred_url":"https://api.github.com/users/humanmade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humanmade/subscriptions","organizations_url":"https://api.github.com/users/humanmade/orgs","repos_url":"https://api.github.com/users/humanmade/repos","events_url":"https://api.github.com/users/humanmade/events{/privacy}","received_events_url":"https://api.github.com/users/humanmade/received_events","type":"Organization","site_admin":false},"repo":{"id":51627815,"node_id":"MDEwOlJlcG9zaXRvcnk1MTYyNzgxNQ==","name":"tachyon","full_name":"humanmade/tachyon","owner":{"login":"humanmade","id":644666,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NDY2Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/644666?v=4","gravatar_id":"","url":"https://api.github.com/users/humanmade","html_url":"https://github.com/humanmade","followers_url":"https://api.github.com/users/humanmade/followers","following_url":"https://api.github.com/users/humanmade/following{/other_user}","gists_url":"https://api.github.com/users/humanmade/gists{/gist_id}","starred_url":"https://api.github.com/users/humanmade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humanmade/subscriptions","organizations_url":"https://api.github.com/users/humanmade/orgs","repos_url":"https://api.github.com/users/humanmade/repos","events_url":"https://api.github.com/users/humanmade/events{/privacy}","received_events_url":"https://api.github.com/users/humanmade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/humanmade/tachyon","description":" Faster than light image resizing service that runs on AWS. Super simple to set up, highly available and very performant. ","fork":false,"url":"https://api.github.com/repos/humanmade/tachyon","forks_url":"https://api.github.com/repos/humanmade/tachyon/forks","keys_url":"https://api.github.com/repos/humanmade/tachyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/humanmade/tachyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/humanmade/tachyon/teams","hooks_url":"https://api.github.com/repos/humanmade/tachyon/hooks","issue_events_url":"https://api.github.com/repos/humanmade/tachyon/issues/events{/number}","events_url":"https://api.github.com/repos/humanmade/tachyon/events","assignees_url":"https://api.github.com/repos/humanmade/tachyon/assignees{/user}","branches_url":"https://api.github.com/repos/humanmade/tachyon/branches{/branch}","tags_url":"https://api.github.com/repos/humanmade/tachyon/tags","blobs_url":"https://api.github.com/repos/humanmade/tachyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/humanmade/tachyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/humanmade/tachyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/humanmade/tachyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/humanmade/tachyon/statuses/{sha}","languages_url":"https://api.github.com/repos/humanmade/tachyon/languages","stargazers_url":"https://api.github.com/repos/humanmade/tachyon/stargazers","contributors_url":"https://api.github.com/repos/humanmade/tachyon/contributors","subscribers_url":"https://api.github.com/repos/humanmade/tachyon/subscribers","subscription_url":"https://api.github.com/repos/humanmade/tachyon/subscription","commits_url":"https://api.github.com/repos/humanmade/tachyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/humanmade/tachyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/humanmade/tachyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/humanmade/tachyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/humanmade/tachyon/contents/{+path}","compare_url":"https://api.github.com/repos/humanmade/tachyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/humanmade/tachyon/merges","archive_url":"https://api.github.com/repos/humanmade/tachyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/humanmade/tachyon/downloads","issues_url":"https://api.github.com/repos/humanmade/tachyon/issues{/number}","pulls_url":"https://api.github.com/repos/humanmade/tachyon/pulls{/number}","milestones_url":"https://api.github.com/repos/humanmade/tachyon/milestones{/number}","notifications_url":"https://api.github.com/repos/humanmade/tachyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/humanmade/tachyon/labels{/name}","releases_url":"https://api.github.com/repos/humanmade/tachyon/releases{/id}","deployments_url":"https://api.github.com/repos/humanmade/tachyon/deployments","created_at":"2016-02-13T01:58:57Z","updated_at":"2018-07-21T09:26:42Z","pushed_at":"2018-07-20T11:10:53Z","git_url":"git://github.com/humanmade/tachyon.git","ssh_url":"git@github.com:humanmade/tachyon.git","clone_url":"https://github.com/humanmade/tachyon.git","svn_url":"https://github.com/humanmade/tachyon","homepage":"https://engineering.hmn.md/projects/tachyon/","size":3167,"stargazers_count":78,"watchers_count":78,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":7,"license":null,"forks":13,"open_issues":7,"watchers":78,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/humanmade/tachyon/pulls/57"},"html":{"href":"https://github.com/humanmade/tachyon/pull/57"},"issue":{"href":"https://api.github.com/repos/humanmade/tachyon/issues/57"},"comments":{"href":"https://api.github.com/repos/humanmade/tachyon/issues/57/comments"},"review_comments":{"href":"https://api.github.com/repos/humanmade/tachyon/pulls/57/comments"},"review_comment":{"href":"https://api.github.com/repos/humanmade/tachyon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/humanmade/tachyon/pulls/57/commits"},"statuses":{"href":"https://api.github.com/repos/humanmade/tachyon/statuses/c2b84630c43079a38a7968725fd2923e3757a681"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"roborourke"}}