{"action":"created","comment":{"url":"https://api.github.com/repos/marksyzm/sickle/pulls/comments/56308992","id":56308992,"diff_hunk":"@@ -108,7 +108,30 @@ function resizeImage (filePath, requestData, data, options, cb) {\n                 var width, height;\n                 var size = metadata.size;\n \n-                if (options.scaleUp || (!options.scaleUp && ( size.width > requestData.width || size.height > requestData.height))) {\n+\n+                // This lets us use just a width or height if desired\n+                if(\"height\" in requestData){\n+                    requestData.height = parseInt(requestData.height)\n+                }\n+\n+                if(\"width\" in requestData){\n+                    requestData.width = parseInt(requestData.width)\n+                }\n+\n+                if(typeof(requestData.height) !== \"undefined\" && typeof(requestData.width) === \"undefined\" ){","path":"index.js","position":24,"original_position":24,"commit_id":"d1a169b9049a7c5c69fc1870f246aaf47b0685e1","original_commit_id":"d1a169b9049a7c5c69fc1870f246aaf47b0685e1","user":{"login":"marksyzm","id":420864,"avatar_url":"https://avatars.githubusercontent.com/u/420864?v=3","gravatar_id":"","url":"https://api.github.com/users/marksyzm","html_url":"https://github.com/marksyzm","followers_url":"https://api.github.com/users/marksyzm/followers","following_url":"https://api.github.com/users/marksyzm/following{/other_user}","gists_url":"https://api.github.com/users/marksyzm/gists{/gist_id}","starred_url":"https://api.github.com/users/marksyzm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marksyzm/subscriptions","organizations_url":"https://api.github.com/users/marksyzm/orgs","repos_url":"https://api.github.com/users/marksyzm/repos","events_url":"https://api.github.com/users/marksyzm/events{/privacy}","received_events_url":"https://api.github.com/users/marksyzm/received_events","type":"User","site_admin":false},"body":"Pedantry, I know, but would you mind putting `typeof(requestData.height)` into the preferred format of `typeof requestData.height` as it's an operator and not a function? Also, you probably should check that they contain numbers instead and reverse the operands as that is the only accepted type for height/width.","created_at":"2016-03-16T10:13:12Z","updated_at":"2016-03-16T10:13:12Z","html_url":"https://github.com/marksyzm/sickle/pull/2#discussion_r56308992","pull_request_url":"https://api.github.com/repos/marksyzm/sickle/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/marksyzm/sickle/pulls/comments/56308992"},"html":{"href":"https://github.com/marksyzm/sickle/pull/2#discussion_r56308992"},"pull_request":{"href":"https://api.github.com/repos/marksyzm/sickle/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/marksyzm/sickle/pulls/2","id":62518000,"html_url":"https://github.com/marksyzm/sickle/pull/2","diff_url":"https://github.com/marksyzm/sickle/pull/2.diff","patch_url":"https://github.com/marksyzm/sickle/pull/2.patch","issue_url":"https://api.github.com/repos/marksyzm/sickle/issues/2","number":2,"state":"open","locked":false,"title":"Allow pulling original size or specifying only height or width","user":{"login":"CalRobert","id":1351621,"avatar_url":"https://avatars.githubusercontent.com/u/1351621?v=3","gravatar_id":"","url":"https://api.github.com/users/CalRobert","html_url":"https://github.com/CalRobert","followers_url":"https://api.github.com/users/CalRobert/followers","following_url":"https://api.github.com/users/CalRobert/following{/other_user}","gists_url":"https://api.github.com/users/CalRobert/gists{/gist_id}","starred_url":"https://api.github.com/users/CalRobert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CalRobert/subscriptions","organizations_url":"https://api.github.com/users/CalRobert/orgs","repos_url":"https://api.github.com/users/CalRobert/repos","events_url":"https://api.github.com/users/CalRobert/events{/privacy}","received_events_url":"https://api.github.com/users/CalRobert/received_events","type":"User","site_admin":false},"body":"This makes it possible to specify an \"originalSize\" option, for no resizing at all. This is helpful if you're using this as a simple cache.\r\n\r\nYou can also choose to specify only a height or width, and the aspect ratio will be preserved.","created_at":"2016-03-11T09:37:12Z","updated_at":"2016-03-16T10:13:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c506f331419e9a9b758668acdb18cbbd128374f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/marksyzm/sickle/pulls/2/commits","review_comments_url":"https://api.github.com/repos/marksyzm/sickle/pulls/2/comments","review_comment_url":"https://api.github.com/repos/marksyzm/sickle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/marksyzm/sickle/issues/2/comments","statuses_url":"https://api.github.com/repos/marksyzm/sickle/statuses/d1a169b9049a7c5c69fc1870f246aaf47b0685e1","head":{"label":"CalRobert:develop","ref":"develop","sha":"d1a169b9049a7c5c69fc1870f246aaf47b0685e1","user":{"login":"CalRobert","id":1351621,"avatar_url":"https://avatars.githubusercontent.com/u/1351621?v=3","gravatar_id":"","url":"https://api.github.com/users/CalRobert","html_url":"https://github.com/CalRobert","followers_url":"https://api.github.com/users/CalRobert/followers","following_url":"https://api.github.com/users/CalRobert/following{/other_user}","gists_url":"https://api.github.com/users/CalRobert/gists{/gist_id}","starred_url":"https://api.github.com/users/CalRobert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CalRobert/subscriptions","organizations_url":"https://api.github.com/users/CalRobert/orgs","repos_url":"https://api.github.com/users/CalRobert/repos","events_url":"https://api.github.com/users/CalRobert/events{/privacy}","received_events_url":"https://api.github.com/users/CalRobert/received_events","type":"User","site_admin":false},"repo":{"id":53654941,"name":"sickle","full_name":"CalRobert/sickle","owner":{"login":"CalRobert","id":1351621,"avatar_url":"https://avatars.githubusercontent.com/u/1351621?v=3","gravatar_id":"","url":"https://api.github.com/users/CalRobert","html_url":"https://github.com/CalRobert","followers_url":"https://api.github.com/users/CalRobert/followers","following_url":"https://api.github.com/users/CalRobert/following{/other_user}","gists_url":"https://api.github.com/users/CalRobert/gists{/gist_id}","starred_url":"https://api.github.com/users/CalRobert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CalRobert/subscriptions","organizations_url":"https://api.github.com/users/CalRobert/orgs","repos_url":"https://api.github.com/users/CalRobert/repos","events_url":"https://api.github.com/users/CalRobert/events{/privacy}","received_events_url":"https://api.github.com/users/CalRobert/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CalRobert/sickle","description":"All purpose image proxy for resizing, caching and output.","fork":true,"url":"https://api.github.com/repos/CalRobert/sickle","forks_url":"https://api.github.com/repos/CalRobert/sickle/forks","keys_url":"https://api.github.com/repos/CalRobert/sickle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CalRobert/sickle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CalRobert/sickle/teams","hooks_url":"https://api.github.com/repos/CalRobert/sickle/hooks","issue_events_url":"https://api.github.com/repos/CalRobert/sickle/issues/events{/number}","events_url":"https://api.github.com/repos/CalRobert/sickle/events","assignees_url":"https://api.github.com/repos/CalRobert/sickle/assignees{/user}","branches_url":"https://api.github.com/repos/CalRobert/sickle/branches{/branch}","tags_url":"https://api.github.com/repos/CalRobert/sickle/tags","blobs_url":"https://api.github.com/repos/CalRobert/sickle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CalRobert/sickle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CalRobert/sickle/git/refs{/sha}","trees_url":"https://api.github.com/repos/CalRobert/sickle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CalRobert/sickle/statuses/{sha}","languages_url":"https://api.github.com/repos/CalRobert/sickle/languages","stargazers_url":"https://api.github.com/repos/CalRobert/sickle/stargazers","contributors_url":"https://api.github.com/repos/CalRobert/sickle/contributors","subscribers_url":"https://api.github.com/repos/CalRobert/sickle/subscribers","subscription_url":"https://api.github.com/repos/CalRobert/sickle/subscription","commits_url":"https://api.github.com/repos/CalRobert/sickle/commits{/sha}","git_commits_url":"https://api.github.com/repos/CalRobert/sickle/git/commits{/sha}","comments_url":"https://api.github.com/repos/CalRobert/sickle/comments{/number}","issue_comment_url":"https://api.github.com/repos/CalRobert/sickle/issues/comments{/number}","contents_url":"https://api.github.com/repos/CalRobert/sickle/contents/{+path}","compare_url":"https://api.github.com/repos/CalRobert/sickle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CalRobert/sickle/merges","archive_url":"https://api.github.com/repos/CalRobert/sickle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CalRobert/sickle/downloads","issues_url":"https://api.github.com/repos/CalRobert/sickle/issues{/number}","pulls_url":"https://api.github.com/repos/CalRobert/sickle/pulls{/number}","milestones_url":"https://api.github.com/repos/CalRobert/sickle/milestones{/number}","notifications_url":"https://api.github.com/repos/CalRobert/sickle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CalRobert/sickle/labels{/name}","releases_url":"https://api.github.com/repos/CalRobert/sickle/releases{/id}","deployments_url":"https://api.github.com/repos/CalRobert/sickle/deployments","created_at":"2016-03-11T09:18:21Z","updated_at":"2016-03-11T09:18:22Z","pushed_at":"2016-03-11T09:34:13Z","git_url":"git://github.com/CalRobert/sickle.git","ssh_url":"git@github.com:CalRobert/sickle.git","clone_url":"https://github.com/CalRobert/sickle.git","svn_url":"https://github.com/CalRobert/sickle","homepage":"","size":500,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"develop"}},"base":{"label":"marksyzm:develop","ref":"develop","sha":"303c914a43874bb89dc9ac525c52ee2423630211","user":{"login":"marksyzm","id":420864,"avatar_url":"https://avatars.githubusercontent.com/u/420864?v=3","gravatar_id":"","url":"https://api.github.com/users/marksyzm","html_url":"https://github.com/marksyzm","followers_url":"https://api.github.com/users/marksyzm/followers","following_url":"https://api.github.com/users/marksyzm/following{/other_user}","gists_url":"https://api.github.com/users/marksyzm/gists{/gist_id}","starred_url":"https://api.github.com/users/marksyzm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marksyzm/subscriptions","organizations_url":"https://api.github.com/users/marksyzm/orgs","repos_url":"https://api.github.com/users/marksyzm/repos","events_url":"https://api.github.com/users/marksyzm/events{/privacy}","received_events_url":"https://api.github.com/users/marksyzm/received_events","type":"User","site_admin":false},"repo":{"id":32408225,"name":"sickle","full_name":"marksyzm/sickle","owner":{"login":"marksyzm","id":420864,"avatar_url":"https://avatars.githubusercontent.com/u/420864?v=3","gravatar_id":"","url":"https://api.github.com/users/marksyzm","html_url":"https://github.com/marksyzm","followers_url":"https://api.github.com/users/marksyzm/followers","following_url":"https://api.github.com/users/marksyzm/following{/other_user}","gists_url":"https://api.github.com/users/marksyzm/gists{/gist_id}","starred_url":"https://api.github.com/users/marksyzm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marksyzm/subscriptions","organizations_url":"https://api.github.com/users/marksyzm/orgs","repos_url":"https://api.github.com/users/marksyzm/repos","events_url":"https://api.github.com/users/marksyzm/events{/privacy}","received_events_url":"https://api.github.com/users/marksyzm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/marksyzm/sickle","description":"All purpose image proxy for resizing, caching and output.","fork":false,"url":"https://api.github.com/repos/marksyzm/sickle","forks_url":"https://api.github.com/repos/marksyzm/sickle/forks","keys_url":"https://api.github.com/repos/marksyzm/sickle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marksyzm/sickle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marksyzm/sickle/teams","hooks_url":"https://api.github.com/repos/marksyzm/sickle/hooks","issue_events_url":"https://api.github.com/repos/marksyzm/sickle/issues/events{/number}","events_url":"https://api.github.com/repos/marksyzm/sickle/events","assignees_url":"https://api.github.com/repos/marksyzm/sickle/assignees{/user}","branches_url":"https://api.github.com/repos/marksyzm/sickle/branches{/branch}","tags_url":"https://api.github.com/repos/marksyzm/sickle/tags","blobs_url":"https://api.github.com/repos/marksyzm/sickle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marksyzm/sickle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marksyzm/sickle/git/refs{/sha}","trees_url":"https://api.github.com/repos/marksyzm/sickle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marksyzm/sickle/statuses/{sha}","languages_url":"https://api.github.com/repos/marksyzm/sickle/languages","stargazers_url":"https://api.github.com/repos/marksyzm/sickle/stargazers","contributors_url":"https://api.github.com/repos/marksyzm/sickle/contributors","subscribers_url":"https://api.github.com/repos/marksyzm/sickle/subscribers","subscription_url":"https://api.github.com/repos/marksyzm/sickle/subscription","commits_url":"https://api.github.com/repos/marksyzm/sickle/commits{/sha}","git_commits_url":"https://api.github.com/repos/marksyzm/sickle/git/commits{/sha}","comments_url":"https://api.github.com/repos/marksyzm/sickle/comments{/number}","issue_comment_url":"https://api.github.com/repos/marksyzm/sickle/issues/comments{/number}","contents_url":"https://api.github.com/repos/marksyzm/sickle/contents/{+path}","compare_url":"https://api.github.com/repos/marksyzm/sickle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marksyzm/sickle/merges","archive_url":"https://api.github.com/repos/marksyzm/sickle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marksyzm/sickle/downloads","issues_url":"https://api.github.com/repos/marksyzm/sickle/issues{/number}","pulls_url":"https://api.github.com/repos/marksyzm/sickle/pulls{/number}","milestones_url":"https://api.github.com/repos/marksyzm/sickle/milestones{/number}","notifications_url":"https://api.github.com/repos/marksyzm/sickle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marksyzm/sickle/labels{/name}","releases_url":"https://api.github.com/repos/marksyzm/sickle/releases{/id}","deployments_url":"https://api.github.com/repos/marksyzm/sickle/deployments","created_at":"2015-03-17T17:13:00Z","updated_at":"2015-03-26T00:02:59Z","pushed_at":"2016-03-11T09:37:13Z","git_url":"git://github.com/marksyzm/sickle.git","ssh_url":"git@github.com:marksyzm/sickle.git","clone_url":"https://github.com/marksyzm/sickle.git","svn_url":"https://github.com/marksyzm/sickle","homepage":"","size":732,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/marksyzm/sickle/pulls/2"},"html":{"href":"https://github.com/marksyzm/sickle/pull/2"},"issue":{"href":"https://api.github.com/repos/marksyzm/sickle/issues/2"},"comments":{"href":"https://api.github.com/repos/marksyzm/sickle/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/marksyzm/sickle/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/marksyzm/sickle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/marksyzm/sickle/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/marksyzm/sickle/statuses/d1a169b9049a7c5c69fc1870f246aaf47b0685e1"}}}}