{"action":"created","issue":{"url":"https://api.github.com/repos/tmpvar/jsdom/issues/1365","labels_url":"https://api.github.com/repos/tmpvar/jsdom/issues/1365/labels{/name}","comments_url":"https://api.github.com/repos/tmpvar/jsdom/issues/1365/comments","events_url":"https://api.github.com/repos/tmpvar/jsdom/issues/1365/events","html_url":"https://github.com/tmpvar/jsdom/issues/1365","id":128594612,"number":1365,"title":"Add optional support for image loading through Canvas.Image","user":{"login":"lehni","id":213275,"avatar_url":"https://avatars.githubusercontent.com/u/213275?v=3","gravatar_id":"","url":"https://api.github.com/users/lehni","html_url":"https://github.com/lehni","followers_url":"https://api.github.com/users/lehni/followers","following_url":"https://api.github.com/users/lehni/following{/other_user}","gists_url":"https://api.github.com/users/lehni/gists{/gist_id}","starred_url":"https://api.github.com/users/lehni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehni/subscriptions","organizations_url":"https://api.github.com/users/lehni/orgs","repos_url":"https://api.github.com/users/lehni/repos","events_url":"https://api.github.com/users/lehni/events{/privacy}","received_events_url":"https://api.github.com/users/lehni/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-25T17:33:03Z","updated_at":"2016-01-25T17:50:49Z","closed_at":null,"body":"Now that there is support for the Canvas API through node-canvas, I think it makes sense to also support image loading through the `Canvas.Image` class from the same module.\r\n\r\nI am willing to work on this, but would need a few pointers, as I am new to the JSDom internals.\r\n\r\nI have looked at the `HTMLCanvasElementImpl` class and understand roughly how to patch this into `HTMLImageElementImpl`. The main problem I am currently facing is that I'm not sure how i am supposed to load the binary image files. Should I use `resourceLoader` for this, or ist that only for text files? \r\n\r\nThis relates to #189, but since this is about an actual implementation through node-canvas, I thought it might be better to open a separate issue."},"comment":{"url":"https://api.github.com/repos/tmpvar/jsdom/issues/comments/174601289","html_url":"https://github.com/tmpvar/jsdom/issues/1365#issuecomment-174601289","issue_url":"https://api.github.com/repos/tmpvar/jsdom/issues/1365","id":174601289,"user":{"login":"lehni","id":213275,"avatar_url":"https://avatars.githubusercontent.com/u/213275?v=3","gravatar_id":"","url":"https://api.github.com/users/lehni","html_url":"https://github.com/lehni","followers_url":"https://api.github.com/users/lehni/followers","following_url":"https://api.github.com/users/lehni/following{/other_user}","gists_url":"https://api.github.com/users/lehni/gists{/gist_id}","starred_url":"https://api.github.com/users/lehni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehni/subscriptions","organizations_url":"https://api.github.com/users/lehni/orgs","repos_url":"https://api.github.com/users/lehni/repos","events_url":"https://api.github.com/users/lehni/events{/privacy}","received_events_url":"https://api.github.com/users/lehni/received_events","type":"User","site_admin":false},"created_at":"2016-01-25T17:50:48Z","updated_at":"2016-01-25T17:50:48Z","body":"Ah, great! This works, I get binary data now:\r\n\r\n    resourceLoader.download(value, { encoding: null }, document._cookieJar, null, (error, data) => {...}"}}