{"action":"created","comment":{"url":"https://api.github.com/repos/propelml/propel/pulls/comments/175270049","pull_request_review_id":104778266,"id":175270049,"diff_hunk":"@@ -75,32 +76,33 @@ export function toUint8Image(image: Tensor): Image {\n   throw new Error(`Unsupported image rank.`);\n }\n \n-function webImageDecoder(filename: string, mode: Mode)\n+async function webImageDecoder(filename: string, mode: Mode)\n     : Promise<Tensor> {\n-  return new Promise((resolve) => {\n-    try {\n-      const img = new Image();\n-      img.onload = function() {\n-        const canvas = document.createElement(\"canvas\");\n-        canvas.width = img.width;\n-        canvas.height = img.height;\n-        const ctx = canvas.getContext(\"2d\");\n-        ctx.drawImage(img, 0, 0);\n-        const pixels = ctx.getImageData(0, 0, canvas.width, canvas.height);\n-        const image: Tensor = toTensor(\n-          Uint8Array.from(pixels.data),\n-          canvas.height,\n-          canvas.width,\n-          mode\n-        );\n-        resolve(image);\n-      };\n-      img.crossOrigin = \"Anonymous\";\n-      img.src = filename;\n-    } catch (e) {\n-      resolve();\n-    }\n-  });\n+  const buffer = await fetchArrayBuffer(filename);\n+  const blob = new Blob( [ buffer ], { type: \"image/jpeg\" } );\n+  const dataURI = window.URL.createObjectURL(blob);\n+\n+  const img = new Image();\n+  let onLoad;\n+  const promise = new Promise(resolve => onLoad = resolve);","path":"src/im.ts","position":null,"original_position":45,"commit_id":"6bfe988e2aaaec3a9b066a060ccc3a9e55af2894","original_commit_id":"4066307fd2d32ba7a62ae08f4376e0e66af6b8f3","user":{"login":"qti3e","id":13242052,"avatar_url":"https://avatars1.githubusercontent.com/u/13242052?v=4","gravatar_id":"","url":"https://api.github.com/users/qti3e","html_url":"https://github.com/qti3e","followers_url":"https://api.github.com/users/qti3e/followers","following_url":"https://api.github.com/users/qti3e/following{/other_user}","gists_url":"https://api.github.com/users/qti3e/gists{/gist_id}","starred_url":"https://api.github.com/users/qti3e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qti3e/subscriptions","organizations_url":"https://api.github.com/users/qti3e/orgs","repos_url":"https://api.github.com/users/qti3e/repos","events_url":"https://api.github.com/users/qti3e/events{/privacy}","received_events_url":"https://api.github.com/users/qti3e/received_events","type":"User","site_admin":false},"body":"thanks, i replaced it","created_at":"2018-03-17T21:01:49Z","updated_at":"2018-03-17T21:01:49Z","html_url":"https://github.com/propelml/propel/pull/386#discussion_r175270049","pull_request_url":"https://api.github.com/repos/propelml/propel/pulls/386","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/propelml/propel/pulls/comments/175270049"},"html":{"href":"https://github.com/propelml/propel/pull/386#discussion_r175270049"},"pull_request":{"href":"https://api.github.com/repos/propelml/propel/pulls/386"}},"in_reply_to_id":175269408},"pull_request":{"url":"https://api.github.com/repos/propelml/propel/pulls/386","id":175718822,"html_url":"https://github.com/propelml/propel/pull/386","diff_url":"https://github.com/propelml/propel/pull/386.diff","patch_url":"https://github.com/propelml/propel/pull/386.patch","issue_url":"https://api.github.com/repos/propelml/propel/issues/386","number":386,"state":"open","locked":false,"title":"[WIP] display progress bar on fetch","user":{"login":"qti3e","id":13242052,"avatar_url":"https://avatars1.githubusercontent.com/u/13242052?v=4","gravatar_id":"","url":"https://api.github.com/users/qti3e","html_url":"https://github.com/qti3e","followers_url":"https://api.github.com/users/qti3e/followers","following_url":"https://api.github.com/users/qti3e/following{/other_user}","gists_url":"https://api.github.com/users/qti3e/gists{/gist_id}","starred_url":"https://api.github.com/users/qti3e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qti3e/subscriptions","organizations_url":"https://api.github.com/users/qti3e/orgs","repos_url":"https://api.github.com/users/qti3e/repos","events_url":"https://api.github.com/users/qti3e/events{/privacy}","received_events_url":"https://api.github.com/users/qti3e/received_events","type":"User","site_admin":false},"body":"todo: design progress bar","created_at":"2018-03-17T20:06:15Z","updated_at":"2018-03-17T21:01:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0040e2dbe518bcb21bfbc98927bd0ab09241902a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/propelml/propel/pulls/386/commits","review_comments_url":"https://api.github.com/repos/propelml/propel/pulls/386/comments","review_comment_url":"https://api.github.com/repos/propelml/propel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/propelml/propel/issues/386/comments","statuses_url":"https://api.github.com/repos/propelml/propel/statuses/6bfe988e2aaaec3a9b066a060ccc3a9e55af2894","head":{"label":"qti3e:q/progressBar","ref":"q/progressBar","sha":"6bfe988e2aaaec3a9b066a060ccc3a9e55af2894","user":{"login":"qti3e","id":13242052,"avatar_url":"https://avatars1.githubusercontent.com/u/13242052?v=4","gravatar_id":"","url":"https://api.github.com/users/qti3e","html_url":"https://github.com/qti3e","followers_url":"https://api.github.com/users/qti3e/followers","following_url":"https://api.github.com/users/qti3e/following{/other_user}","gists_url":"https://api.github.com/users/qti3e/gists{/gist_id}","starred_url":"https://api.github.com/users/qti3e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qti3e/subscriptions","organizations_url":"https://api.github.com/users/qti3e/orgs","repos_url":"https://api.github.com/users/qti3e/repos","events_url":"https://api.github.com/users/qti3e/events{/privacy}","received_events_url":"https://api.github.com/users/qti3e/received_events","type":"User","site_admin":false},"repo":{"id":120956451,"name":"propel","full_name":"qti3e/propel","owner":{"login":"qti3e","id":13242052,"avatar_url":"https://avatars1.githubusercontent.com/u/13242052?v=4","gravatar_id":"","url":"https://api.github.com/users/qti3e","html_url":"https://github.com/qti3e","followers_url":"https://api.github.com/users/qti3e/followers","following_url":"https://api.github.com/users/qti3e/following{/other_user}","gists_url":"https://api.github.com/users/qti3e/gists{/gist_id}","starred_url":"https://api.github.com/users/qti3e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qti3e/subscriptions","organizations_url":"https://api.github.com/users/qti3e/orgs","repos_url":"https://api.github.com/users/qti3e/repos","events_url":"https://api.github.com/users/qti3e/events{/privacy}","received_events_url":"https://api.github.com/users/qti3e/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/qti3e/propel","description":"Differential Programming in JavaScript.","fork":true,"url":"https://api.github.com/repos/qti3e/propel","forks_url":"https://api.github.com/repos/qti3e/propel/forks","keys_url":"https://api.github.com/repos/qti3e/propel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qti3e/propel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qti3e/propel/teams","hooks_url":"https://api.github.com/repos/qti3e/propel/hooks","issue_events_url":"https://api.github.com/repos/qti3e/propel/issues/events{/number}","events_url":"https://api.github.com/repos/qti3e/propel/events","assignees_url":"https://api.github.com/repos/qti3e/propel/assignees{/user}","branches_url":"https://api.github.com/repos/qti3e/propel/branches{/branch}","tags_url":"https://api.github.com/repos/qti3e/propel/tags","blobs_url":"https://api.github.com/repos/qti3e/propel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qti3e/propel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qti3e/propel/git/refs{/sha}","trees_url":"https://api.github.com/repos/qti3e/propel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qti3e/propel/statuses/{sha}","languages_url":"https://api.github.com/repos/qti3e/propel/languages","stargazers_url":"https://api.github.com/repos/qti3e/propel/stargazers","contributors_url":"https://api.github.com/repos/qti3e/propel/contributors","subscribers_url":"https://api.github.com/repos/qti3e/propel/subscribers","subscription_url":"https://api.github.com/repos/qti3e/propel/subscription","commits_url":"https://api.github.com/repos/qti3e/propel/commits{/sha}","git_commits_url":"https://api.github.com/repos/qti3e/propel/git/commits{/sha}","comments_url":"https://api.github.com/repos/qti3e/propel/comments{/number}","issue_comment_url":"https://api.github.com/repos/qti3e/propel/issues/comments{/number}","contents_url":"https://api.github.com/repos/qti3e/propel/contents/{+path}","compare_url":"https://api.github.com/repos/qti3e/propel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qti3e/propel/merges","archive_url":"https://api.github.com/repos/qti3e/propel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qti3e/propel/downloads","issues_url":"https://api.github.com/repos/qti3e/propel/issues{/number}","pulls_url":"https://api.github.com/repos/qti3e/propel/pulls{/number}","milestones_url":"https://api.github.com/repos/qti3e/propel/milestones{/number}","notifications_url":"https://api.github.com/repos/qti3e/propel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qti3e/propel/labels{/name}","releases_url":"https://api.github.com/repos/qti3e/propel/releases{/id}","deployments_url":"https://api.github.com/repos/qti3e/propel/deployments","created_at":"2018-02-09T21:15:22Z","updated_at":"2018-02-09T21:15:24Z","pushed_at":"2018-03-17T20:47:39Z","git_url":"git://github.com/qti3e/propel.git","ssh_url":"git@github.com:qti3e/propel.git","clone_url":"https://github.com/qti3e/propel.git","svn_url":"https://github.com/qti3e/propel","homepage":"http://propelml.org/","size":6267,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"propelml:master","ref":"master","sha":"3eedd9139ab0a6a6dbbcd81a3e1f1285cffc823e","user":{"login":"propelml","id":33702266,"avatar_url":"https://avatars1.githubusercontent.com/u/33702266?v=4","gravatar_id":"","url":"https://api.github.com/users/propelml","html_url":"https://github.com/propelml","followers_url":"https://api.github.com/users/propelml/followers","following_url":"https://api.github.com/users/propelml/following{/other_user}","gists_url":"https://api.github.com/users/propelml/gists{/gist_id}","starred_url":"https://api.github.com/users/propelml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/propelml/subscriptions","organizations_url":"https://api.github.com/users/propelml/orgs","repos_url":"https://api.github.com/users/propelml/repos","events_url":"https://api.github.com/users/propelml/events{/privacy}","received_events_url":"https://api.github.com/users/propelml/received_events","type":"Organization","site_admin":false},"repo":{"id":110989998,"name":"propel","full_name":"propelml/propel","owner":{"login":"propelml","id":33702266,"avatar_url":"https://avatars1.githubusercontent.com/u/33702266?v=4","gravatar_id":"","url":"https://api.github.com/users/propelml","html_url":"https://github.com/propelml","followers_url":"https://api.github.com/users/propelml/followers","following_url":"https://api.github.com/users/propelml/following{/other_user}","gists_url":"https://api.github.com/users/propelml/gists{/gist_id}","starred_url":"https://api.github.com/users/propelml/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/propelml/subscriptions","organizations_url":"https://api.github.com/users/propelml/orgs","repos_url":"https://api.github.com/users/propelml/repos","events_url":"https://api.github.com/users/propelml/events{/privacy}","received_events_url":"https://api.github.com/users/propelml/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/propelml/propel","description":"Differential Programming in JavaScript.","fork":false,"url":"https://api.github.com/repos/propelml/propel","forks_url":"https://api.github.com/repos/propelml/propel/forks","keys_url":"https://api.github.com/repos/propelml/propel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/propelml/propel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/propelml/propel/teams","hooks_url":"https://api.github.com/repos/propelml/propel/hooks","issue_events_url":"https://api.github.com/repos/propelml/propel/issues/events{/number}","events_url":"https://api.github.com/repos/propelml/propel/events","assignees_url":"https://api.github.com/repos/propelml/propel/assignees{/user}","branches_url":"https://api.github.com/repos/propelml/propel/branches{/branch}","tags_url":"https://api.github.com/repos/propelml/propel/tags","blobs_url":"https://api.github.com/repos/propelml/propel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/propelml/propel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/propelml/propel/git/refs{/sha}","trees_url":"https://api.github.com/repos/propelml/propel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/propelml/propel/statuses/{sha}","languages_url":"https://api.github.com/repos/propelml/propel/languages","stargazers_url":"https://api.github.com/repos/propelml/propel/stargazers","contributors_url":"https://api.github.com/repos/propelml/propel/contributors","subscribers_url":"https://api.github.com/repos/propelml/propel/subscribers","subscription_url":"https://api.github.com/repos/propelml/propel/subscription","commits_url":"https://api.github.com/repos/propelml/propel/commits{/sha}","git_commits_url":"https://api.github.com/repos/propelml/propel/git/commits{/sha}","comments_url":"https://api.github.com/repos/propelml/propel/comments{/number}","issue_comment_url":"https://api.github.com/repos/propelml/propel/issues/comments{/number}","contents_url":"https://api.github.com/repos/propelml/propel/contents/{+path}","compare_url":"https://api.github.com/repos/propelml/propel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/propelml/propel/merges","archive_url":"https://api.github.com/repos/propelml/propel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/propelml/propel/downloads","issues_url":"https://api.github.com/repos/propelml/propel/issues{/number}","pulls_url":"https://api.github.com/repos/propelml/propel/pulls{/number}","milestones_url":"https://api.github.com/repos/propelml/propel/milestones{/number}","notifications_url":"https://api.github.com/repos/propelml/propel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/propelml/propel/labels{/name}","releases_url":"https://api.github.com/repos/propelml/propel/releases{/id}","deployments_url":"https://api.github.com/repos/propelml/propel/deployments","created_at":"2017-11-16T15:42:09Z","updated_at":"2018-03-17T20:38:32Z","pushed_at":"2018-03-17T20:53:10Z","git_url":"git://github.com/propelml/propel.git","ssh_url":"git@github.com:propelml/propel.git","clone_url":"https://github.com/propelml/propel.git","svn_url":"https://github.com/propelml/propel","homepage":"http://propelml.org/","size":6397,"stargazers_count":2371,"watchers_count":2371,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":60,"mirror_url":null,"archived":false,"open_issues_count":42,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":60,"open_issues":42,"watchers":2371,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/propelml/propel/pulls/386"},"html":{"href":"https://github.com/propelml/propel/pull/386"},"issue":{"href":"https://api.github.com/repos/propelml/propel/issues/386"},"comments":{"href":"https://api.github.com/repos/propelml/propel/issues/386/comments"},"review_comments":{"href":"https://api.github.com/repos/propelml/propel/pulls/386/comments"},"review_comment":{"href":"https://api.github.com/repos/propelml/propel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/propelml/propel/pulls/386/commits"},"statuses":{"href":"https://api.github.com/repos/propelml/propel/statuses/6bfe988e2aaaec3a9b066a060ccc3a9e55af2894"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"qti3e"}}