{"action":"closed","issue":{"url":"https://api.github.com/repos/paperjs/paper.js/issues/924","labels_url":"https://api.github.com/repos/paperjs/paper.js/issues/924/labels{/name}","comments_url":"https://api.github.com/repos/paperjs/paper.js/issues/924/comments","events_url":"https://api.github.com/repos/paperjs/paper.js/issues/924/events","html_url":"https://github.com/paperjs/paper.js/issues/924","id":128203686,"number":924,"title":"onLoad not called when loading paper.Raster from canvas","user":{"login":"sebastian-nowak","id":5895458,"avatar_url":"https://avatars.githubusercontent.com/u/5895458?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastian-nowak","html_url":"https://github.com/sebastian-nowak","followers_url":"https://api.github.com/users/sebastian-nowak/followers","following_url":"https://api.github.com/users/sebastian-nowak/following{/other_user}","gists_url":"https://api.github.com/users/sebastian-nowak/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastian-nowak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastian-nowak/subscriptions","organizations_url":"https://api.github.com/users/sebastian-nowak/orgs","repos_url":"https://api.github.com/users/sebastian-nowak/repos","events_url":"https://api.github.com/users/sebastian-nowak/events{/privacy}","received_events_url":"https://api.github.com/users/sebastian-nowak/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/paperjs/paper.js/labels/cat:%20event-handling","name":"cat: event-handling","color":"c7def8"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-22T17:26:15Z","updated_at":"2016-01-26T20:07:17Z","closed_at":"2016-01-26T20:07:17Z","body":"According to the docs `source: HTMLImageElement⟋HTMLCanvasElement⟋String — the source of the raster` so `paper.Raster(source, ...)` constructor should work correctly when given a canvas.\r\n\r\nLet's try this:\r\n```\r\nvar raster = new paper.Raster(someCanvas, new paper.Point(0, 0));\r\nraster.onLoad = function ()\r\n{\r\n  alert('This function is not called');\r\n};\r\n```\r\n\r\nIf we replace someCanvas with url or data url, the `onLoad` callback is called. When given a canvas, it loads successfully but callback isn't invoked. Tested on paper 0.9.25.\r\n\r\n// Edit: after looking into the source, it appears that onLoad won't be called when passed an image too.\r\n"}}