{"action":"created","comment":{"url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pulls/comments/93094830","pull_request_review_id":13610767,"id":93094830,"diff_hunk":"@@ -0,0 +1,27 @@\n+'use strict';\n+\n+const fs = require('fs');\n+\n+// CreateBmp will read the palette-bitmap.bmp file, then create a colorTable array of the 1024 bytes that represent the bitmap file's color table.\n+// The color table is found by starting the offset after the bitmap file header and the DIB header.\n+// The bitmap file header is always 14 bytes.\n+// This particular bitmap file header identifies the file type as BM, which means the DIB header corresponds to Windows 3.1x, 95, NT, etc.\n+// This makes it a DIB Header with the name BITMAPINFOHEADER, which has a size of 40 bytes.\n+// We can double check our DIB Header size using the buffer method readInt32LE(14), which will read the signed integer 14 bytes in (where the DIB header starts).\n+// So, the bitmap file header and the DIB header are a combined total of 54 bytes, so our color table should start at the 54th position of our buffer.\n+// We know where the color table ends because the pixel array immediately follows the color table, and the pixel array can be found 10 bytes in to\n+// the bitmap file header using the buffer method readInt32LE(10), which will read the signed integer 10 bytes in.\n+// We get back the value 1078, so we know the pixel array begins at the 1078th location.\n+// We can double check that our colorTable is the correct size by checking how many colors this bitmap file is expected to have.\n+// The DIB BITMAPINFOHEADER contains this information at an offset of 46 bytes, so if we use the buffer method readInt32LE(46), we get back a value\n+// of 256, meaning this bitmap file has 256 colors.\n+// Since each color is 4 bytes, we would expect a color table to be (256 x 4 = 1024) bytes in size. This matches our expected range of 54 bytes to 1078\n+// bytes (1078 - 54 = 1024), so we can be sure we have correctly selected the color table from our buffer.","path":"bitmap-steven-hawa-caleb/model/bitmap-constructor.js","position":19,"original_position":19,"commit_id":"0ed29fc32bfc4a55cba21b45c5d68dcbd2e75acf","original_commit_id":"0ed29fc32bfc4a55cba21b45c5d68dcbd2e75acf","user":{"login":"bnates","id":14863122,"avatar_url":"https://avatars.githubusercontent.com/u/14863122?v=3","gravatar_id":"","url":"https://api.github.com/users/bnates","html_url":"https://github.com/bnates","followers_url":"https://api.github.com/users/bnates/followers","following_url":"https://api.github.com/users/bnates/following{/other_user}","gists_url":"https://api.github.com/users/bnates/gists{/gist_id}","starred_url":"https://api.github.com/users/bnates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bnates/subscriptions","organizations_url":"https://api.github.com/users/bnates/orgs","repos_url":"https://api.github.com/users/bnates/repos","events_url":"https://api.github.com/users/bnates/events{/privacy}","received_events_url":"https://api.github.com/users/bnates/received_events","type":"User","site_admin":false},"body":"@maschigokae @BatemanVO @abdih17 - fantastic comments!","created_at":"2016-12-19T18:52:13Z","updated_at":"2016-12-19T18:56:51Z","html_url":"https://github.com/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pull/20#discussion_r93094830","pull_request_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pulls/comments/93094830"},"html":{"href":"https://github.com/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pull/20#discussion_r93094830"},"pull_request":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pulls/20","id":97659263,"html_url":"https://github.com/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pull/20","diff_url":"https://github.com/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pull/20.diff","patch_url":"https://github.com/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pull/20.patch","issue_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/issues/20","number":20,"state":"open","locked":false,"title":"04-Lab (Hawa Steven Caleb)","user":{"login":"maschigokae","id":15165856,"avatar_url":"https://avatars.githubusercontent.com/u/15165856?v=3","gravatar_id":"","url":"https://api.github.com/users/maschigokae","html_url":"https://github.com/maschigokae","followers_url":"https://api.github.com/users/maschigokae/followers","following_url":"https://api.github.com/users/maschigokae/following{/other_user}","gists_url":"https://api.github.com/users/maschigokae/gists{/gist_id}","starred_url":"https://api.github.com/users/maschigokae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maschigokae/subscriptions","organizations_url":"https://api.github.com/users/maschigokae/orgs","repos_url":"https://api.github.com/users/maschigokae/repos","events_url":"https://api.github.com/users/maschigokae/events{/privacy}","received_events_url":"https://api.github.com/users/maschigokae/received_events","type":"User","site_admin":false},"body":"Lab #04 Bitmap transformer, by Hawa, Steven and Caleb.","created_at":"2016-12-12T23:48:34Z","updated_at":"2016-12-19T18:56:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6943168800f4cde9b8e1c9bc52664a686d2295e5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pulls/20/commits","review_comments_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pulls/20/comments","review_comment_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/issues/20/comments","statuses_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/statuses/0ed29fc32bfc4a55cba21b45c5d68dcbd2e75acf","head":{"label":"BatemanVO:master","ref":"master","sha":"0ed29fc32bfc4a55cba21b45c5d68dcbd2e75acf","user":{"login":"BatemanVO","id":20998142,"avatar_url":"https://avatars.githubusercontent.com/u/20998142?v=3","gravatar_id":"","url":"https://api.github.com/users/BatemanVO","html_url":"https://github.com/BatemanVO","followers_url":"https://api.github.com/users/BatemanVO/followers","following_url":"https://api.github.com/users/BatemanVO/following{/other_user}","gists_url":"https://api.github.com/users/BatemanVO/gists{/gist_id}","starred_url":"https://api.github.com/users/BatemanVO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BatemanVO/subscriptions","organizations_url":"https://api.github.com/users/BatemanVO/orgs","repos_url":"https://api.github.com/users/BatemanVO/repos","events_url":"https://api.github.com/users/BatemanVO/events{/privacy}","received_events_url":"https://api.github.com/users/BatemanVO/received_events","type":"User","site_admin":false},"repo":{"id":76058064,"name":"04-bitmap-transformer","full_name":"BatemanVO/04-bitmap-transformer","owner":{"login":"BatemanVO","id":20998142,"avatar_url":"https://avatars.githubusercontent.com/u/20998142?v=3","gravatar_id":"","url":"https://api.github.com/users/BatemanVO","html_url":"https://github.com/BatemanVO","followers_url":"https://api.github.com/users/BatemanVO/followers","following_url":"https://api.github.com/users/BatemanVO/following{/other_user}","gists_url":"https://api.github.com/users/BatemanVO/gists{/gist_id}","starred_url":"https://api.github.com/users/BatemanVO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BatemanVO/subscriptions","organizations_url":"https://api.github.com/users/BatemanVO/orgs","repos_url":"https://api.github.com/users/BatemanVO/repos","events_url":"https://api.github.com/users/BatemanVO/events{/privacy}","received_events_url":"https://api.github.com/users/BatemanVO/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BatemanVO/04-bitmap-transformer","description":"Lab 04 - Bitmap Transformer","fork":true,"url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer","forks_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/forks","keys_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/teams","hooks_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/hooks","issue_events_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/issues/events{/number}","events_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/events","assignees_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/assignees{/user}","branches_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/branches{/branch}","tags_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/tags","blobs_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/git/refs{/sha}","trees_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/statuses/{sha}","languages_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/languages","stargazers_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/stargazers","contributors_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/contributors","subscribers_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/subscribers","subscription_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/subscription","commits_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/commits{/sha}","git_commits_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/git/commits{/sha}","comments_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/comments{/number}","issue_comment_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/issues/comments{/number}","contents_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/contents/{+path}","compare_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/merges","archive_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/downloads","issues_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/issues{/number}","pulls_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/pulls{/number}","milestones_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/milestones{/number}","notifications_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/labels{/name}","releases_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/releases{/id}","deployments_url":"https://api.github.com/repos/BatemanVO/04-bitmap-transformer/deployments","created_at":"2016-12-09T17:55:51Z","updated_at":"2016-12-09T18:57:41Z","pushed_at":"2016-12-13T20:14:43Z","git_url":"git://github.com/BatemanVO/04-bitmap-transformer.git","ssh_url":"git@github.com:BatemanVO/04-bitmap-transformer.git","clone_url":"https://github.com/BatemanVO/04-bitmap-transformer.git","svn_url":"https://github.com/BatemanVO/04-bitmap-transformer","homepage":null,"size":35,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"codefellows-seattle-javascript-401d12:master","ref":"master","sha":"dfb5f7480ad2c72957e8eb9fbb1095e740da5fc4","user":{"login":"codefellows-seattle-javascript-401d12","id":24280530,"avatar_url":"https://avatars.githubusercontent.com/u/24280530?v=3","gravatar_id":"","url":"https://api.github.com/users/codefellows-seattle-javascript-401d12","html_url":"https://github.com/codefellows-seattle-javascript-401d12","followers_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/followers","following_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/following{/other_user}","gists_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/gists{/gist_id}","starred_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/subscriptions","organizations_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/orgs","repos_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/repos","events_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/events{/privacy}","received_events_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/received_events","type":"Organization","site_admin":false},"repo":{"id":75988301,"name":"04-bitmap-transformer","full_name":"codefellows-seattle-javascript-401d12/04-bitmap-transformer","owner":{"login":"codefellows-seattle-javascript-401d12","id":24280530,"avatar_url":"https://avatars.githubusercontent.com/u/24280530?v=3","gravatar_id":"","url":"https://api.github.com/users/codefellows-seattle-javascript-401d12","html_url":"https://github.com/codefellows-seattle-javascript-401d12","followers_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/followers","following_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/following{/other_user}","gists_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/gists{/gist_id}","starred_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/subscriptions","organizations_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/orgs","repos_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/repos","events_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/events{/privacy}","received_events_url":"https://api.github.com/users/codefellows-seattle-javascript-401d12/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codefellows-seattle-javascript-401d12/04-bitmap-transformer","description":"Lab 04 - Bitmap Transformer","fork":false,"url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer","forks_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/forks","keys_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/teams","hooks_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/hooks","issue_events_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/issues/events{/number}","events_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/events","assignees_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/assignees{/user}","branches_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/branches{/branch}","tags_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/tags","blobs_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/git/refs{/sha}","trees_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/statuses/{sha}","languages_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/languages","stargazers_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/stargazers","contributors_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/contributors","subscribers_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/subscribers","subscription_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/subscription","commits_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/commits{/sha}","git_commits_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/git/commits{/sha}","comments_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/comments{/number}","issue_comment_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/issues/comments{/number}","contents_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/contents/{+path}","compare_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/merges","archive_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/downloads","issues_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/issues{/number}","pulls_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pulls{/number}","milestones_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/milestones{/number}","notifications_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/labels{/name}","releases_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/releases{/id}","deployments_url":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/deployments","created_at":"2016-12-09T01:00:26Z","updated_at":"2016-12-09T01:00:26Z","pushed_at":"2016-12-13T23:34:39Z","git_url":"git://github.com/codefellows-seattle-javascript-401d12/04-bitmap-transformer.git","ssh_url":"git@github.com:codefellows-seattle-javascript-401d12/04-bitmap-transformer.git","clone_url":"https://github.com/codefellows-seattle-javascript-401d12/04-bitmap-transformer.git","svn_url":"https://github.com/codefellows-seattle-javascript-401d12/04-bitmap-transformer","homepage":null,"size":7,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":10,"forks":10,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pulls/20"},"html":{"href":"https://github.com/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pull/20"},"issue":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/issues/20"},"comments":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401d12/04-bitmap-transformer/statuses/0ed29fc32bfc4a55cba21b45c5d68dcbd2e75acf"}}}}
{"actor":{"display_login":"bnates"}}