{"action":"created","comment":{"url":"https://api.github.com/repos/mapnik/node-mapnik/pulls/comments/34731097","id":34731097,"diff_hunk":"@@ -1620,6 +1644,131 @@ void Image::EIO_AfterOpen(uv_work_t* req)\n     delete closure;\n }\n \n+// Read from a Buffer\n+NAN_METHOD(Image::fromSVGBytesSync)\n+{\n+    NanScope();\n+    NanReturnValue(_fromSVGSync(false, args));\n+}\n+\n+// Read from a file\n+NAN_METHOD(Image::fromSVGSync)\n+{\n+    NanScope();\n+    NanReturnValue(_fromSVGSync(true, args));\n+}\n+\n+Local<Value> Image::_fromSVGSync(bool fromFile, _NAN_METHOD_ARGS)\n+{\n+    NanEscapableScope();\n+\n+    if (!fromFile && (args.Length() < 1 || !args[0]->IsObject())) {\n+        NanThrowTypeError(\"must provide a buffer argument\");\n+        return NanEscapeScope(NanUndefined());\n+    }\n+\n+    if (fromFile && (args.Length() < 1 || !args[0]->IsString())) {\n+        NanThrowTypeError(\"must provide a filename argument\");\n+        return NanEscapeScope(NanUndefined());\n+    }\n+\n+\n+    double scale = 1.0;\n+    if (args.Length() >= 2) {\n+        if (!args[1]->IsObject()) {\n+            NanThrowTypeError(\"optional second arg must be an options object\");\n+            return NanEscapeScope(NanUndefined());","path":"src/mapnik_image.cpp","position":82,"original_position":82,"commit_id":"a42c75fbf0ea9ce0d9b3dff78c9f20243bca6d2b","original_commit_id":"a42c75fbf0ea9ce0d9b3dff78c9f20243bca6d2b","user":{"login":"flippmoke","id":1794907,"avatar_url":"https://avatars.githubusercontent.com/u/1794907?v=3","gravatar_id":"","url":"https://api.github.com/users/flippmoke","html_url":"https://github.com/flippmoke","followers_url":"https://api.github.com/users/flippmoke/followers","following_url":"https://api.github.com/users/flippmoke/following{/other_user}","gists_url":"https://api.github.com/users/flippmoke/gists{/gist_id}","starred_url":"https://api.github.com/users/flippmoke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flippmoke/subscriptions","organizations_url":"https://api.github.com/users/flippmoke/orgs","repos_url":"https://api.github.com/users/flippmoke/repos","events_url":"https://api.github.com/users/flippmoke/events{/privacy}","received_events_url":"https://api.github.com/users/flippmoke/received_events","type":"User","site_admin":false},"body":"Don't see a unit test to cover this error.","created_at":"2015-07-15T21:22:18Z","updated_at":"2015-07-15T21:22:18Z","html_url":"https://github.com/mapnik/node-mapnik/pull/469#discussion_r34731097","pull_request_url":"https://api.github.com/repos/mapnik/node-mapnik/pulls/469","_links":{"self":{"href":"https://api.github.com/repos/mapnik/node-mapnik/pulls/comments/34731097"},"html":{"href":"https://github.com/mapnik/node-mapnik/pull/469#discussion_r34731097"},"pull_request":{"href":"https://api.github.com/repos/mapnik/node-mapnik/pulls/469"}}},"pull_request":{"url":"https://api.github.com/repos/mapnik/node-mapnik/pulls/469","id":38292859,"html_url":"https://github.com/mapnik/node-mapnik/pull/469","diff_url":"https://github.com/mapnik/node-mapnik/pull/469.diff","patch_url":"https://github.com/mapnik/node-mapnik/pull/469.patch","issue_url":"https://api.github.com/repos/mapnik/node-mapnik/issues/469","number":469,"state":"open","locked":false,"title":"Svg -> Image rasterizer","user":{"login":"springmeyer","id":20300,"avatar_url":"https://avatars.githubusercontent.com/u/20300?v=3","gravatar_id":"","url":"https://api.github.com/users/springmeyer","html_url":"https://github.com/springmeyer","followers_url":"https://api.github.com/users/springmeyer/followers","following_url":"https://api.github.com/users/springmeyer/following{/other_user}","gists_url":"https://api.github.com/users/springmeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/springmeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/springmeyer/subscriptions","organizations_url":"https://api.github.com/users/springmeyer/orgs","repos_url":"https://api.github.com/users/springmeyer/repos","events_url":"https://api.github.com/users/springmeyer/events{/privacy}","received_events_url":"https://api.github.com/users/springmeyer/received_events","type":"User","site_admin":false},"body":"Before merging:\r\n\r\n  - [x] @tmcw takes for a spin, confirms this is looking good\r\n  - [ ] **node-mapnik**: add async versions of each function (currently only sync are available)\r\n  - [ ] **node-mapnik**: tests for async versions\r\n  - [ ] **mapnik core**: Mapnik core's svg parser currently does not throw but rather prints to stderr on invalid or unparseable SVG. This likely needs to be fixed so that it throws in order for node-mapnik API users to respond appropriately.\r\n  - [ ] **mapnik core**: Improve code coverage - we have some major gaps of SVG parsing given the tests in mapnik core: https://coveralls.io/files/932605888\r\n  - [ ] **mapnik core**: Add unit tests to mapnik core of SVG rasterization <-- we lack this. Without it we will not see regressions in SVG support that might impact `spritezero` until way late in the release cycle.","created_at":"2015-06-23T01:13:08Z","updated_at":"2015-07-15T21:22:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"986c1f49388a313a9ab539001f9001399767225f","assignee":null,"milestone":{"url":"https://api.github.com/repos/mapnik/node-mapnik/milestones/13","html_url":"https://github.com/mapnik/node-mapnik/milestones/v3.5.0","labels_url":"https://api.github.com/repos/mapnik/node-mapnik/milestones/13/labels","id":1035421,"number":13,"title":"v3.5.0","description":"","creator":{"login":"springmeyer","id":20300,"avatar_url":"https://avatars.githubusercontent.com/u/20300?v=3","gravatar_id":"","url":"https://api.github.com/users/springmeyer","html_url":"https://github.com/springmeyer","followers_url":"https://api.github.com/users/springmeyer/followers","following_url":"https://api.github.com/users/springmeyer/following{/other_user}","gists_url":"https://api.github.com/users/springmeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/springmeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/springmeyer/subscriptions","organizations_url":"https://api.github.com/users/springmeyer/orgs","repos_url":"https://api.github.com/users/springmeyer/repos","events_url":"https://api.github.com/users/springmeyer/events{/privacy}","received_events_url":"https://api.github.com/users/springmeyer/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":8,"state":"open","created_at":"2015-03-23T23:30:24Z","updated_at":"2015-07-10T21:12:58Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/mapnik/node-mapnik/pulls/469/commits","review_comments_url":"https://api.github.com/repos/mapnik/node-mapnik/pulls/469/comments","review_comment_url":"https://api.github.com/repos/mapnik/node-mapnik/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapnik/node-mapnik/issues/469/comments","statuses_url":"https://api.github.com/repos/mapnik/node-mapnik/statuses/a42c75fbf0ea9ce0d9b3dff78c9f20243bca6d2b","head":{"label":"mapnik:svg-rasterizer2","ref":"svg-rasterizer2","sha":"a42c75fbf0ea9ce0d9b3dff78c9f20243bca6d2b","user":{"login":"mapnik","id":318055,"avatar_url":"https://avatars.githubusercontent.com/u/318055?v=3","gravatar_id":"","url":"https://api.github.com/users/mapnik","html_url":"https://github.com/mapnik","followers_url":"https://api.github.com/users/mapnik/followers","following_url":"https://api.github.com/users/mapnik/following{/other_user}","gists_url":"https://api.github.com/users/mapnik/gists{/gist_id}","starred_url":"https://api.github.com/users/mapnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapnik/subscriptions","organizations_url":"https://api.github.com/users/mapnik/orgs","repos_url":"https://api.github.com/users/mapnik/repos","events_url":"https://api.github.com/users/mapnik/events{/privacy}","received_events_url":"https://api.github.com/users/mapnik/received_events","type":"Organization","site_admin":false},"repo":{"id":1084114,"name":"node-mapnik","full_name":"mapnik/node-mapnik","owner":{"login":"mapnik","id":318055,"avatar_url":"https://avatars.githubusercontent.com/u/318055?v=3","gravatar_id":"","url":"https://api.github.com/users/mapnik","html_url":"https://github.com/mapnik","followers_url":"https://api.github.com/users/mapnik/followers","following_url":"https://api.github.com/users/mapnik/following{/other_user}","gists_url":"https://api.github.com/users/mapnik/gists{/gist_id}","starred_url":"https://api.github.com/users/mapnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapnik/subscriptions","organizations_url":"https://api.github.com/users/mapnik/orgs","repos_url":"https://api.github.com/users/mapnik/repos","events_url":"https://api.github.com/users/mapnik/events{/privacy}","received_events_url":"https://api.github.com/users/mapnik/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapnik/node-mapnik","description":"Bindings to mapnik for node.js","fork":false,"url":"https://api.github.com/repos/mapnik/node-mapnik","forks_url":"https://api.github.com/repos/mapnik/node-mapnik/forks","keys_url":"https://api.github.com/repos/mapnik/node-mapnik/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapnik/node-mapnik/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapnik/node-mapnik/teams","hooks_url":"https://api.github.com/repos/mapnik/node-mapnik/hooks","issue_events_url":"https://api.github.com/repos/mapnik/node-mapnik/issues/events{/number}","events_url":"https://api.github.com/repos/mapnik/node-mapnik/events","assignees_url":"https://api.github.com/repos/mapnik/node-mapnik/assignees{/user}","branches_url":"https://api.github.com/repos/mapnik/node-mapnik/branches{/branch}","tags_url":"https://api.github.com/repos/mapnik/node-mapnik/tags","blobs_url":"https://api.github.com/repos/mapnik/node-mapnik/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapnik/node-mapnik/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapnik/node-mapnik/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapnik/node-mapnik/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapnik/node-mapnik/statuses/{sha}","languages_url":"https://api.github.com/repos/mapnik/node-mapnik/languages","stargazers_url":"https://api.github.com/repos/mapnik/node-mapnik/stargazers","contributors_url":"https://api.github.com/repos/mapnik/node-mapnik/contributors","subscribers_url":"https://api.github.com/repos/mapnik/node-mapnik/subscribers","subscription_url":"https://api.github.com/repos/mapnik/node-mapnik/subscription","commits_url":"https://api.github.com/repos/mapnik/node-mapnik/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapnik/node-mapnik/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapnik/node-mapnik/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapnik/node-mapnik/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapnik/node-mapnik/contents/{+path}","compare_url":"https://api.github.com/repos/mapnik/node-mapnik/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapnik/node-mapnik/merges","archive_url":"https://api.github.com/repos/mapnik/node-mapnik/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapnik/node-mapnik/downloads","issues_url":"https://api.github.com/repos/mapnik/node-mapnik/issues{/number}","pulls_url":"https://api.github.com/repos/mapnik/node-mapnik/pulls{/number}","milestones_url":"https://api.github.com/repos/mapnik/node-mapnik/milestones{/number}","notifications_url":"https://api.github.com/repos/mapnik/node-mapnik/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapnik/node-mapnik/labels{/name}","releases_url":"https://api.github.com/repos/mapnik/node-mapnik/releases{/id}","created_at":"2010-11-16T04:00:45Z","updated_at":"2015-07-02T02:12:35Z","pushed_at":"2015-07-15T20:32:48Z","git_url":"git://github.com/mapnik/node-mapnik.git","ssh_url":"git@github.com:mapnik/node-mapnik.git","clone_url":"https://github.com/mapnik/node-mapnik.git","svn_url":"https://github.com/mapnik/node-mapnik","homepage":"https://github.com/mapnik/node-mapnik","size":21384,"stargazers_count":221,"watchers_count":221,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":70,"mirror_url":null,"open_issues_count":42,"forks":70,"open_issues":42,"watchers":221,"default_branch":"master"}},"base":{"label":"mapnik:master","ref":"master","sha":"8ab7cf01a740946dfe3211a000139bb545c27439","user":{"login":"mapnik","id":318055,"avatar_url":"https://avatars.githubusercontent.com/u/318055?v=3","gravatar_id":"","url":"https://api.github.com/users/mapnik","html_url":"https://github.com/mapnik","followers_url":"https://api.github.com/users/mapnik/followers","following_url":"https://api.github.com/users/mapnik/following{/other_user}","gists_url":"https://api.github.com/users/mapnik/gists{/gist_id}","starred_url":"https://api.github.com/users/mapnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapnik/subscriptions","organizations_url":"https://api.github.com/users/mapnik/orgs","repos_url":"https://api.github.com/users/mapnik/repos","events_url":"https://api.github.com/users/mapnik/events{/privacy}","received_events_url":"https://api.github.com/users/mapnik/received_events","type":"Organization","site_admin":false},"repo":{"id":1084114,"name":"node-mapnik","full_name":"mapnik/node-mapnik","owner":{"login":"mapnik","id":318055,"avatar_url":"https://avatars.githubusercontent.com/u/318055?v=3","gravatar_id":"","url":"https://api.github.com/users/mapnik","html_url":"https://github.com/mapnik","followers_url":"https://api.github.com/users/mapnik/followers","following_url":"https://api.github.com/users/mapnik/following{/other_user}","gists_url":"https://api.github.com/users/mapnik/gists{/gist_id}","starred_url":"https://api.github.com/users/mapnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapnik/subscriptions","organizations_url":"https://api.github.com/users/mapnik/orgs","repos_url":"https://api.github.com/users/mapnik/repos","events_url":"https://api.github.com/users/mapnik/events{/privacy}","received_events_url":"https://api.github.com/users/mapnik/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapnik/node-mapnik","description":"Bindings to mapnik for node.js","fork":false,"url":"https://api.github.com/repos/mapnik/node-mapnik","forks_url":"https://api.github.com/repos/mapnik/node-mapnik/forks","keys_url":"https://api.github.com/repos/mapnik/node-mapnik/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapnik/node-mapnik/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapnik/node-mapnik/teams","hooks_url":"https://api.github.com/repos/mapnik/node-mapnik/hooks","issue_events_url":"https://api.github.com/repos/mapnik/node-mapnik/issues/events{/number}","events_url":"https://api.github.com/repos/mapnik/node-mapnik/events","assignees_url":"https://api.github.com/repos/mapnik/node-mapnik/assignees{/user}","branches_url":"https://api.github.com/repos/mapnik/node-mapnik/branches{/branch}","tags_url":"https://api.github.com/repos/mapnik/node-mapnik/tags","blobs_url":"https://api.github.com/repos/mapnik/node-mapnik/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapnik/node-mapnik/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapnik/node-mapnik/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapnik/node-mapnik/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapnik/node-mapnik/statuses/{sha}","languages_url":"https://api.github.com/repos/mapnik/node-mapnik/languages","stargazers_url":"https://api.github.com/repos/mapnik/node-mapnik/stargazers","contributors_url":"https://api.github.com/repos/mapnik/node-mapnik/contributors","subscribers_url":"https://api.github.com/repos/mapnik/node-mapnik/subscribers","subscription_url":"https://api.github.com/repos/mapnik/node-mapnik/subscription","commits_url":"https://api.github.com/repos/mapnik/node-mapnik/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapnik/node-mapnik/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapnik/node-mapnik/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapnik/node-mapnik/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapnik/node-mapnik/contents/{+path}","compare_url":"https://api.github.com/repos/mapnik/node-mapnik/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapnik/node-mapnik/merges","archive_url":"https://api.github.com/repos/mapnik/node-mapnik/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapnik/node-mapnik/downloads","issues_url":"https://api.github.com/repos/mapnik/node-mapnik/issues{/number}","pulls_url":"https://api.github.com/repos/mapnik/node-mapnik/pulls{/number}","milestones_url":"https://api.github.com/repos/mapnik/node-mapnik/milestones{/number}","notifications_url":"https://api.github.com/repos/mapnik/node-mapnik/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapnik/node-mapnik/labels{/name}","releases_url":"https://api.github.com/repos/mapnik/node-mapnik/releases{/id}","created_at":"2010-11-16T04:00:45Z","updated_at":"2015-07-02T02:12:35Z","pushed_at":"2015-07-15T20:32:48Z","git_url":"git://github.com/mapnik/node-mapnik.git","ssh_url":"git@github.com:mapnik/node-mapnik.git","clone_url":"https://github.com/mapnik/node-mapnik.git","svn_url":"https://github.com/mapnik/node-mapnik","homepage":"https://github.com/mapnik/node-mapnik","size":21384,"stargazers_count":221,"watchers_count":221,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":70,"mirror_url":null,"open_issues_count":42,"forks":70,"open_issues":42,"watchers":221,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapnik/node-mapnik/pulls/469"},"html":{"href":"https://github.com/mapnik/node-mapnik/pull/469"},"issue":{"href":"https://api.github.com/repos/mapnik/node-mapnik/issues/469"},"comments":{"href":"https://api.github.com/repos/mapnik/node-mapnik/issues/469/comments"},"review_comments":{"href":"https://api.github.com/repos/mapnik/node-mapnik/pulls/469/comments"},"review_comment":{"href":"https://api.github.com/repos/mapnik/node-mapnik/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapnik/node-mapnik/pulls/469/commits"},"statuses":{"href":"https://api.github.com/repos/mapnik/node-mapnik/statuses/a42c75fbf0ea9ce0d9b3dff78c9f20243bca6d2b"}}}}