{"action":"created","issue":{"url":"https://api.github.com/repos/brendan-duncan/image/issues/22","labels_url":"https://api.github.com/repos/brendan-duncan/image/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/brendan-duncan/image/issues/22/comments","events_url":"https://api.github.com/repos/brendan-duncan/image/issues/22/events","html_url":"https://github.com/brendan-duncan/image/issues/22","id":36684415,"number":22,"title":"Wrong RGB values from JPEG images","user":{"login":"nelsonsilva","id":6028,"avatar_url":"https://avatars.githubusercontent.com/u/6028?v=3","gravatar_id":"","url":"https://api.github.com/users/nelsonsilva","html_url":"https://github.com/nelsonsilva","followers_url":"https://api.github.com/users/nelsonsilva/followers","following_url":"https://api.github.com/users/nelsonsilva/following{/other_user}","gists_url":"https://api.github.com/users/nelsonsilva/gists{/gist_id}","starred_url":"https://api.github.com/users/nelsonsilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelsonsilva/subscriptions","organizations_url":"https://api.github.com/users/nelsonsilva/orgs","repos_url":"https://api.github.com/users/nelsonsilva/repos","events_url":"https://api.github.com/users/nelsonsilva/events{/privacy}","received_events_url":"https://api.github.com/users/nelsonsilva/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/brendan-duncan/image/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"brendan-duncan","id":3642099,"avatar_url":"https://avatars.githubusercontent.com/u/3642099?v=3","gravatar_id":"","url":"https://api.github.com/users/brendan-duncan","html_url":"https://github.com/brendan-duncan","followers_url":"https://api.github.com/users/brendan-duncan/followers","following_url":"https://api.github.com/users/brendan-duncan/following{/other_user}","gists_url":"https://api.github.com/users/brendan-duncan/gists{/gist_id}","starred_url":"https://api.github.com/users/brendan-duncan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendan-duncan/subscriptions","organizations_url":"https://api.github.com/users/brendan-duncan/orgs","repos_url":"https://api.github.com/users/brendan-duncan/repos","events_url":"https://api.github.com/users/brendan-duncan/events{/privacy}","received_events_url":"https://api.github.com/users/brendan-duncan/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2014-06-27T16:50:23Z","updated_at":"2015-04-29T06:37:33Z","closed_at":null,"body":"I'm experimenting with the JPEG decoder and there seems to be an issue with the RGB values.\r\n\r\nI added this to the existing JPEG decode/encode test:\r\n\r\n```\r\n// Check RGB color extraction\r\nexpect(toRGB(image.getPixel(0, 0)), [48, 47, 45]);\r\nexpect(toRGB(image.getPixel(0, image.height)), [85, 81, 98]);\r\nexpect(toRGB(image.getPixel(image.width, 0)), [89, 103, 77]);\r\nexpect(toRGB(image.getPixel(image.width, image.height)), [40, 47, 39]);\r\n```\r\nwhere toRGB is simply defined as:\r\n```\r\nList<int> toRGB(int pixel) => [getRed(pixel), getGreen(pixel), getBlue(pixel)];\r\n```\r\nand the expected colors where extracted with GIMP.\r\n\r\nThe test fails right at the first pixel (0,0):\r\n```\r\nFAIL: JPEG decode/encode\r\nExpected: [48, 47, 45]\r\nActual: [48, 46, 45]\r\n```"},"comment":{"url":"https://api.github.com/repos/brendan-duncan/image/issues/comments/97323667","html_url":"https://github.com/brendan-duncan/image/issues/22#issuecomment-97323667","issue_url":"https://api.github.com/repos/brendan-duncan/image/issues/22","id":97323667,"user":{"login":"brendan-duncan","id":3642099,"avatar_url":"https://avatars.githubusercontent.com/u/3642099?v=3","gravatar_id":"","url":"https://api.github.com/users/brendan-duncan","html_url":"https://github.com/brendan-duncan","followers_url":"https://api.github.com/users/brendan-duncan/followers","following_url":"https://api.github.com/users/brendan-duncan/following{/other_user}","gists_url":"https://api.github.com/users/brendan-duncan/gists{/gist_id}","starred_url":"https://api.github.com/users/brendan-duncan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendan-duncan/subscriptions","organizations_url":"https://api.github.com/users/brendan-duncan/orgs","repos_url":"https://api.github.com/users/brendan-duncan/repos","events_url":"https://api.github.com/users/brendan-duncan/events{/privacy}","received_events_url":"https://api.github.com/users/brendan-duncan/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T06:37:33Z","updated_at":"2015-04-29T06:37:33Z","body":"As soon as I can get some spare time, I'll be rewriting the jpeg decoder to avoid these rounding errors. Sorry for the inconvenience until I get it fixed, though jpeg by its nature is a lossy format an occasional rounding error isn't a huge deal.  I'll try and get to it soon, I'm realizing time is going by quickly and somehow it's approaching a year since this issue was opened."}}