{"action":"created","issue":{"url":"https://api.github.com/repos/kangax/fabric.js/issues/335","labels_url":"https://api.github.com/repos/kangax/fabric.js/issues/335/labels{/name}","comments_url":"https://api.github.com/repos/kangax/fabric.js/issues/335/comments","events_url":"https://api.github.com/repos/kangax/fabric.js/issues/335/events","html_url":"https://github.com/kangax/fabric.js/pull/335","id":8973769,"number":335,"title":"Node.js - allow loadImage to support data url","user":{"login":"TimNZ","id":1051701,"avatar_url":"https://avatars.githubusercontent.com/u/1051701?v=3","gravatar_id":"","url":"https://api.github.com/users/TimNZ","html_url":"https://github.com/TimNZ","followers_url":"https://api.github.com/users/TimNZ/followers","following_url":"https://api.github.com/users/TimNZ/following{/other_user}","gists_url":"https://api.github.com/users/TimNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/TimNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimNZ/subscriptions","organizations_url":"https://api.github.com/users/TimNZ/orgs","repos_url":"https://api.github.com/users/TimNZ/repos","events_url":"https://api.github.com/users/TimNZ/events{/privacy}","received_events_url":"https://api.github.com/users/TimNZ/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2012-12-04T04:56:33Z","updated_at":"2015-11-28T09:05:59Z","closed_at":"2012-12-06T18:49:29Z","pull_request":{"url":"https://api.github.com/repos/kangax/fabric.js/pulls/335","html_url":"https://github.com/kangax/fabric.js/pull/335","diff_url":"https://github.com/kangax/fabric.js/pull/335.diff","patch_url":"https://github.com/kangax/fabric.js/pull/335.patch"},"body":"The overload for fabric.util.loadImage when run under node.js did not accomodate data:image url.\n\nThis could be optimised as src duplicates _src.\n\nI need it to handle this scenario so that the data url is embedded in toSVG().\nPerhaps some option to toggle when xlink:href should be original url or data url.\n\nDriven by inkscape not supporting external href.\n\nAs it stands the changes still need tweaking due to above considerations.\n\n<pre>\nfabric.util.loadImage('https://www.google.co.nz/images/srpr/logo3w.png', function(img) {\n\tvar oImg = new fabric.Image(img);\n\toImg.toDataURL(function(e)\n\t{\n\t\timg.src = img._src = e;\n\t\tvar oImg2 = new fabric.Image(img);\n\t\tcanvas.add(oImg2);\n\t\tconsole.log(canvas.toSVG());\n\t});\n})\n</pre>"},"comment":{"url":"https://api.github.com/repos/kangax/fabric.js/issues/comments/160265521","html_url":"https://github.com/kangax/fabric.js/pull/335#issuecomment-160265521","issue_url":"https://api.github.com/repos/kangax/fabric.js/issues/335","id":160265521,"user":{"login":"asturur","id":1194048,"avatar_url":"https://avatars.githubusercontent.com/u/1194048?v=3","gravatar_id":"","url":"https://api.github.com/users/asturur","html_url":"https://github.com/asturur","followers_url":"https://api.github.com/users/asturur/followers","following_url":"https://api.github.com/users/asturur/following{/other_user}","gists_url":"https://api.github.com/users/asturur/gists{/gist_id}","starred_url":"https://api.github.com/users/asturur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asturur/subscriptions","organizations_url":"https://api.github.com/users/asturur/orgs","repos_url":"https://api.github.com/users/asturur/repos","events_url":"https://api.github.com/users/asturur/events{/privacy}","received_events_url":"https://api.github.com/users/asturur/received_events","type":"User","site_admin":false},"created_at":"2015-11-28T09:05:59Z","updated_at":"2015-11-28T09:05:59Z","body":"please, you posted same question with different line number on three threads.\n\nthis sounds more a stack overflow question. prepare a minimal jsfiddle that generate the error and post a issue or a stack overflow question. i sure that you understand that the error, outasode the context that is happening, is meaningless"}}