{"action":"created","comment":{"url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/comments/33504886","id":33504886,"diff_hunk":"@@ -1,17 +1,48 @@\n var lwip = require('lwip'),\n+    fs = require('fs'),\n     Promise = require('bluebird');\n \n+\n+// Backwards compatibility for array checking\n+if (typeof Array.isArray === 'undefined') {\n+  Array.isArray = function(obj) {\n+    return Object.prototype.toString.call(obj) === '[object Array]';\n+  }\n+};\n+\n var handleImage = function (image, size) {\n     return new Promise(function (resolve, reject) {\n-        // Flatten the array for buffer loading\n-        var flattened = [];\n-        flattened = flattened.concat.apply(flattened, image);\n+        var input, options;\n+        if (Array.isArray(image)) {\n+            // Flatten the array for buffer loading\n+            var flattened = [];\n+            flattened = flattened.concat.apply(flattened, image);\n+            input = new Buffer(flattened);\n+            options = {\n+                  width: image.length\n+                , height: image[0].length\n+            };\n+\n+            console.warn(\n+                \"Image input as an array will be deprecated in the next major release\"\n+            );\n+        } else if (typeof image === 'string') {\n+            if (image.length <= 260 && fs.lstatSync(image).isFile()) {\n+                input = image;","path":"lib/image.js","position":34,"original_position":34,"commit_id":"c3a4b0d1e76a92559ded4226b44d5175a2cd487f","original_commit_id":"c3a4b0d1e76a92559ded4226b44d5175a2cd487f","user":{"login":"sihrc","id":3360831,"avatar_url":"https://avatars.githubusercontent.com/u/3360831?v=3","gravatar_id":"","url":"https://api.github.com/users/sihrc","html_url":"https://github.com/sihrc","followers_url":"https://api.github.com/users/sihrc/followers","following_url":"https://api.github.com/users/sihrc/following{/other_user}","gists_url":"https://api.github.com/users/sihrc/gists{/gist_id}","starred_url":"https://api.github.com/users/sihrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sihrc/subscriptions","organizations_url":"https://api.github.com/users/sihrc/orgs","repos_url":"https://api.github.com/users/sihrc/repos","events_url":"https://api.github.com/users/sihrc/events{/privacy}","received_events_url":"https://api.github.com/users/sihrc/received_events","type":"User","site_admin":false},"body":"A function just returns if its a file?","created_at":"2015-06-29T19:54:26Z","updated_at":"2015-06-29T19:54:26Z","html_url":"https://github.com/IndicoDataSolutions/IndicoIo-node/pull/42#discussion_r33504886","pull_request_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/42","_links":{"self":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/comments/33504886"},"html":{"href":"https://github.com/IndicoDataSolutions/IndicoIo-node/pull/42#discussion_r33504886"},"pull_request":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/42","id":38788013,"html_url":"https://github.com/IndicoDataSolutions/IndicoIo-node/pull/42","diff_url":"https://github.com/IndicoDataSolutions/IndicoIo-node/pull/42.diff","patch_url":"https://github.com/IndicoDataSolutions/IndicoIo-node/pull/42.patch","issue_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/42","number":42,"state":"open","locked":false,"title":"ADD: Image input as filepath and base64","user":{"login":"sihrc","id":3360831,"avatar_url":"https://avatars.githubusercontent.com/u/3360831?v=3","gravatar_id":"","url":"https://api.github.com/users/sihrc","html_url":"https://github.com/sihrc","followers_url":"https://api.github.com/users/sihrc/followers","following_url":"https://api.github.com/users/sihrc/following{/other_user}","gists_url":"https://api.github.com/users/sihrc/gists{/gist_id}","starred_url":"https://api.github.com/users/sihrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sihrc/subscriptions","organizations_url":"https://api.github.com/users/sihrc/orgs","repos_url":"https://api.github.com/users/sihrc/repos","events_url":"https://api.github.com/users/sihrc/events{/privacy}","received_events_url":"https://api.github.com/users/sihrc/received_events","type":"User","site_admin":false},"body":"Resolves #41 ","created_at":"2015-06-29T15:50:27Z","updated_at":"2015-06-29T19:54:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd2fa02cb3aa2445a4de9045650d73afc26f4398","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/42/commits","review_comments_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/42/comments","review_comment_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/42/comments","statuses_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/statuses/c3a4b0d1e76a92559ded4226b44d5175a2cd487f","head":{"label":"IndicoDataSolutions:Chris/filepath-base64","ref":"Chris/filepath-base64","sha":"c3a4b0d1e76a92559ded4226b44d5175a2cd487f","user":{"login":"IndicoDataSolutions","id":6751793,"avatar_url":"https://avatars.githubusercontent.com/u/6751793?v=3","gravatar_id":"","url":"https://api.github.com/users/IndicoDataSolutions","html_url":"https://github.com/IndicoDataSolutions","followers_url":"https://api.github.com/users/IndicoDataSolutions/followers","following_url":"https://api.github.com/users/IndicoDataSolutions/following{/other_user}","gists_url":"https://api.github.com/users/IndicoDataSolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/IndicoDataSolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IndicoDataSolutions/subscriptions","organizations_url":"https://api.github.com/users/IndicoDataSolutions/orgs","repos_url":"https://api.github.com/users/IndicoDataSolutions/repos","events_url":"https://api.github.com/users/IndicoDataSolutions/events{/privacy}","received_events_url":"https://api.github.com/users/IndicoDataSolutions/received_events","type":"Organization","site_admin":false},"repo":{"id":20789554,"name":"IndicoIo-node","full_name":"IndicoDataSolutions/IndicoIo-node","owner":{"login":"IndicoDataSolutions","id":6751793,"avatar_url":"https://avatars.githubusercontent.com/u/6751793?v=3","gravatar_id":"","url":"https://api.github.com/users/IndicoDataSolutions","html_url":"https://github.com/IndicoDataSolutions","followers_url":"https://api.github.com/users/IndicoDataSolutions/followers","following_url":"https://api.github.com/users/IndicoDataSolutions/following{/other_user}","gists_url":"https://api.github.com/users/IndicoDataSolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/IndicoDataSolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IndicoDataSolutions/subscriptions","organizations_url":"https://api.github.com/users/IndicoDataSolutions/orgs","repos_url":"https://api.github.com/users/IndicoDataSolutions/repos","events_url":"https://api.github.com/users/IndicoDataSolutions/events{/privacy}","received_events_url":"https://api.github.com/users/IndicoDataSolutions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IndicoDataSolutions/IndicoIo-node","description":"A Node.js wrapper for the Indico API","fork":false,"url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node","forks_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/forks","keys_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/teams","hooks_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/hooks","issue_events_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/events{/number}","events_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/events","assignees_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/assignees{/user}","branches_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/branches{/branch}","tags_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/tags","blobs_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/statuses/{sha}","languages_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/languages","stargazers_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/stargazers","contributors_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/contributors","subscribers_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/subscribers","subscription_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/subscription","commits_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/contents/{+path}","compare_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/merges","archive_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/downloads","issues_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues{/number}","pulls_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls{/number}","milestones_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/milestones{/number}","notifications_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/labels{/name}","releases_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/releases{/id}","created_at":"2014-06-13T02:23:12Z","updated_at":"2015-05-19T07:30:23Z","pushed_at":"2015-06-29T17:26:14Z","git_url":"git://github.com/IndicoDataSolutions/IndicoIo-node.git","ssh_url":"git@github.com:IndicoDataSolutions/IndicoIo-node.git","clone_url":"https://github.com/IndicoDataSolutions/IndicoIo-node.git","svn_url":"https://github.com/IndicoDataSolutions/IndicoIo-node","homepage":"","size":652,"stargazers_count":17,"watchers_count":17,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":7,"forks":3,"open_issues":7,"watchers":17,"default_branch":"master"}},"base":{"label":"IndicoDataSolutions:development","ref":"development","sha":"cf61c3da279c604422ba1f51fe8668f67df61795","user":{"login":"IndicoDataSolutions","id":6751793,"avatar_url":"https://avatars.githubusercontent.com/u/6751793?v=3","gravatar_id":"","url":"https://api.github.com/users/IndicoDataSolutions","html_url":"https://github.com/IndicoDataSolutions","followers_url":"https://api.github.com/users/IndicoDataSolutions/followers","following_url":"https://api.github.com/users/IndicoDataSolutions/following{/other_user}","gists_url":"https://api.github.com/users/IndicoDataSolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/IndicoDataSolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IndicoDataSolutions/subscriptions","organizations_url":"https://api.github.com/users/IndicoDataSolutions/orgs","repos_url":"https://api.github.com/users/IndicoDataSolutions/repos","events_url":"https://api.github.com/users/IndicoDataSolutions/events{/privacy}","received_events_url":"https://api.github.com/users/IndicoDataSolutions/received_events","type":"Organization","site_admin":false},"repo":{"id":20789554,"name":"IndicoIo-node","full_name":"IndicoDataSolutions/IndicoIo-node","owner":{"login":"IndicoDataSolutions","id":6751793,"avatar_url":"https://avatars.githubusercontent.com/u/6751793?v=3","gravatar_id":"","url":"https://api.github.com/users/IndicoDataSolutions","html_url":"https://github.com/IndicoDataSolutions","followers_url":"https://api.github.com/users/IndicoDataSolutions/followers","following_url":"https://api.github.com/users/IndicoDataSolutions/following{/other_user}","gists_url":"https://api.github.com/users/IndicoDataSolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/IndicoDataSolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IndicoDataSolutions/subscriptions","organizations_url":"https://api.github.com/users/IndicoDataSolutions/orgs","repos_url":"https://api.github.com/users/IndicoDataSolutions/repos","events_url":"https://api.github.com/users/IndicoDataSolutions/events{/privacy}","received_events_url":"https://api.github.com/users/IndicoDataSolutions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IndicoDataSolutions/IndicoIo-node","description":"A Node.js wrapper for the Indico API","fork":false,"url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node","forks_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/forks","keys_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/teams","hooks_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/hooks","issue_events_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/events{/number}","events_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/events","assignees_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/assignees{/user}","branches_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/branches{/branch}","tags_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/tags","blobs_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/statuses/{sha}","languages_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/languages","stargazers_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/stargazers","contributors_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/contributors","subscribers_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/subscribers","subscription_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/subscription","commits_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/contents/{+path}","compare_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/merges","archive_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/downloads","issues_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues{/number}","pulls_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls{/number}","milestones_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/milestones{/number}","notifications_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/labels{/name}","releases_url":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/releases{/id}","created_at":"2014-06-13T02:23:12Z","updated_at":"2015-05-19T07:30:23Z","pushed_at":"2015-06-29T17:26:14Z","git_url":"git://github.com/IndicoDataSolutions/IndicoIo-node.git","ssh_url":"git@github.com:IndicoDataSolutions/IndicoIo-node.git","clone_url":"https://github.com/IndicoDataSolutions/IndicoIo-node.git","svn_url":"https://github.com/IndicoDataSolutions/IndicoIo-node","homepage":"","size":652,"stargazers_count":17,"watchers_count":17,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":7,"forks":3,"open_issues":7,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/42"},"html":{"href":"https://github.com/IndicoDataSolutions/IndicoIo-node/pull/42"},"issue":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/42"},"comments":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/IndicoDataSolutions/IndicoIo-node/statuses/c3a4b0d1e76a92559ded4226b44d5175a2cd487f"}}}}