{"action":"created","comment":{"url":"https://api.github.com/repos/pytest-dev/pytest-html/pulls/comments/89311498","pull_request_review_id":9856351,"id":89311498,"diff_hunk":"@@ -8,17 +8,33 @@\n FORMAT_TEXT = 'text'\n FORMAT_URL = 'url'\n \n+TYPE_JPG = ('image/jpeg', 'jpg')\n+TYPE_PNG = ('image/png', 'png')\n+TYPE_SVG = ('image/svg+xml', 'svg')\n \n-def extra(content, format, name=None):\n-    return {'name': name, 'format': format, 'content': content}\n+\n+def extra(content, format, name=None, type=None):\n+    return {'name': name, 'format': format, 'content': content, 'type': type}\n \n \n def html(content):\n     return extra(content, FORMAT_HTML)\n \n \n def image(content, name='Image'):\n-    return extra(content, FORMAT_IMAGE, name)\n+    return imagePNG(content=content, name=name)\n+\n+\n+def imagePNG(content, name='Image'):\n+    return extra(content, FORMAT_IMAGE, name, type=TYPE_PNG)\n+\n+\n+def imageJPG(content, name='Image'):\n+    return extra(content, FORMAT_IMAGE, name, type=TYPE_JPG)\n+\n+\n+def imageSVG(content, name='Image'):\n+    return extra(content, FORMAT_IMAGE, name, type=TYPE_SVG)","path":"pytest_html/extras.py","position":33,"original_position":33,"commit_id":"5327f8e138cc4defbebbbcd84dbd71b6379c0284","original_commit_id":"5327f8e138cc4defbebbbcd84dbd71b6379c0284","user":{"login":"davehunt","id":122800,"avatar_url":"https://avatars.githubusercontent.com/u/122800?v=3","gravatar_id":"","url":"https://api.github.com/users/davehunt","html_url":"https://github.com/davehunt","followers_url":"https://api.github.com/users/davehunt/followers","following_url":"https://api.github.com/users/davehunt/following{/other_user}","gists_url":"https://api.github.com/users/davehunt/gists{/gist_id}","starred_url":"https://api.github.com/users/davehunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davehunt/subscriptions","organizations_url":"https://api.github.com/users/davehunt/orgs","repos_url":"https://api.github.com/users/davehunt/repos","events_url":"https://api.github.com/users/davehunt/events{/privacy}","received_events_url":"https://api.github.com/users/davehunt/received_events","type":"User","site_admin":false},"body":"I'm undecided on these helper functions. I think allowing users the specify the mime type and extension gives them full flexibility without too much complexity, but I can also see the advantage of them.","created_at":"2016-11-23T13:05:24Z","updated_at":"2016-11-23T13:08:49Z","html_url":"https://github.com/pytest-dev/pytest-html/pull/87#discussion_r89311498","pull_request_url":"https://api.github.com/repos/pytest-dev/pytest-html/pulls/87","_links":{"self":{"href":"https://api.github.com/repos/pytest-dev/pytest-html/pulls/comments/89311498"},"html":{"href":"https://github.com/pytest-dev/pytest-html/pull/87#discussion_r89311498"},"pull_request":{"href":"https://api.github.com/repos/pytest-dev/pytest-html/pulls/87"}}},"pull_request":{"url":"https://api.github.com/repos/pytest-dev/pytest-html/pulls/87","id":93334726,"html_url":"https://github.com/pytest-dev/pytest-html/pull/87","diff_url":"https://github.com/pytest-dev/pytest-html/pull/87.diff","patch_url":"https://github.com/pytest-dev/pytest-html/pull/87.patch","issue_url":"https://api.github.com/repos/pytest-dev/pytest-html/issues/87","number":87,"state":"open","locked":false,"title":"Add support for jpg and svg","user":{"login":"bhzunami","id":3340922,"avatar_url":"https://avatars.githubusercontent.com/u/3340922?v=3","gravatar_id":"","url":"https://api.github.com/users/bhzunami","html_url":"https://github.com/bhzunami","followers_url":"https://api.github.com/users/bhzunami/followers","following_url":"https://api.github.com/users/bhzunami/following{/other_user}","gists_url":"https://api.github.com/users/bhzunami/gists{/gist_id}","starred_url":"https://api.github.com/users/bhzunami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhzunami/subscriptions","organizations_url":"https://api.github.com/users/bhzunami/orgs","repos_url":"https://api.github.com/users/bhzunami/repos","events_url":"https://api.github.com/users/bhzunami/events{/privacy}","received_events_url":"https://api.github.com/users/bhzunami/received_events","type":"User","site_admin":false},"body":"It would be nice if the report support JPEG and SVG images. At the moment it only supports PNG. And if the image is not a png the browser can't display the image properly.\r\n","created_at":"2016-11-11T13:49:25Z","updated_at":"2016-11-23T13:08:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88a5e74328ea8284d421db7ec88b1e7373ee0797","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pytest-dev/pytest-html/pulls/87/commits","review_comments_url":"https://api.github.com/repos/pytest-dev/pytest-html/pulls/87/comments","review_comment_url":"https://api.github.com/repos/pytest-dev/pytest-html/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pytest-dev/pytest-html/issues/87/comments","statuses_url":"https://api.github.com/repos/pytest-dev/pytest-html/statuses/5327f8e138cc4defbebbbcd84dbd71b6379c0284","head":{"label":"bhzunami:multiple_images","ref":"multiple_images","sha":"5327f8e138cc4defbebbbcd84dbd71b6379c0284","user":{"login":"bhzunami","id":3340922,"avatar_url":"https://avatars.githubusercontent.com/u/3340922?v=3","gravatar_id":"","url":"https://api.github.com/users/bhzunami","html_url":"https://github.com/bhzunami","followers_url":"https://api.github.com/users/bhzunami/followers","following_url":"https://api.github.com/users/bhzunami/following{/other_user}","gists_url":"https://api.github.com/users/bhzunami/gists{/gist_id}","starred_url":"https://api.github.com/users/bhzunami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhzunami/subscriptions","organizations_url":"https://api.github.com/users/bhzunami/orgs","repos_url":"https://api.github.com/users/bhzunami/repos","events_url":"https://api.github.com/users/bhzunami/events{/privacy}","received_events_url":"https://api.github.com/users/bhzunami/received_events","type":"User","site_admin":false},"repo":{"id":73480029,"name":"pytest-html","full_name":"bhzunami/pytest-html","owner":{"login":"bhzunami","id":3340922,"avatar_url":"https://avatars.githubusercontent.com/u/3340922?v=3","gravatar_id":"","url":"https://api.github.com/users/bhzunami","html_url":"https://github.com/bhzunami","followers_url":"https://api.github.com/users/bhzunami/followers","following_url":"https://api.github.com/users/bhzunami/following{/other_user}","gists_url":"https://api.github.com/users/bhzunami/gists{/gist_id}","starred_url":"https://api.github.com/users/bhzunami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhzunami/subscriptions","organizations_url":"https://api.github.com/users/bhzunami/orgs","repos_url":"https://api.github.com/users/bhzunami/repos","events_url":"https://api.github.com/users/bhzunami/events{/privacy}","received_events_url":"https://api.github.com/users/bhzunami/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bhzunami/pytest-html","description":"Plugin for generating HTML reports for py.test results","fork":true,"url":"https://api.github.com/repos/bhzunami/pytest-html","forks_url":"https://api.github.com/repos/bhzunami/pytest-html/forks","keys_url":"https://api.github.com/repos/bhzunami/pytest-html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bhzunami/pytest-html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bhzunami/pytest-html/teams","hooks_url":"https://api.github.com/repos/bhzunami/pytest-html/hooks","issue_events_url":"https://api.github.com/repos/bhzunami/pytest-html/issues/events{/number}","events_url":"https://api.github.com/repos/bhzunami/pytest-html/events","assignees_url":"https://api.github.com/repos/bhzunami/pytest-html/assignees{/user}","branches_url":"https://api.github.com/repos/bhzunami/pytest-html/branches{/branch}","tags_url":"https://api.github.com/repos/bhzunami/pytest-html/tags","blobs_url":"https://api.github.com/repos/bhzunami/pytest-html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bhzunami/pytest-html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bhzunami/pytest-html/git/refs{/sha}","trees_url":"https://api.github.com/repos/bhzunami/pytest-html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bhzunami/pytest-html/statuses/{sha}","languages_url":"https://api.github.com/repos/bhzunami/pytest-html/languages","stargazers_url":"https://api.github.com/repos/bhzunami/pytest-html/stargazers","contributors_url":"https://api.github.com/repos/bhzunami/pytest-html/contributors","subscribers_url":"https://api.github.com/repos/bhzunami/pytest-html/subscribers","subscription_url":"https://api.github.com/repos/bhzunami/pytest-html/subscription","commits_url":"https://api.github.com/repos/bhzunami/pytest-html/commits{/sha}","git_commits_url":"https://api.github.com/repos/bhzunami/pytest-html/git/commits{/sha}","comments_url":"https://api.github.com/repos/bhzunami/pytest-html/comments{/number}","issue_comment_url":"https://api.github.com/repos/bhzunami/pytest-html/issues/comments{/number}","contents_url":"https://api.github.com/repos/bhzunami/pytest-html/contents/{+path}","compare_url":"https://api.github.com/repos/bhzunami/pytest-html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bhzunami/pytest-html/merges","archive_url":"https://api.github.com/repos/bhzunami/pytest-html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bhzunami/pytest-html/downloads","issues_url":"https://api.github.com/repos/bhzunami/pytest-html/issues{/number}","pulls_url":"https://api.github.com/repos/bhzunami/pytest-html/pulls{/number}","milestones_url":"https://api.github.com/repos/bhzunami/pytest-html/milestones{/number}","notifications_url":"https://api.github.com/repos/bhzunami/pytest-html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bhzunami/pytest-html/labels{/name}","releases_url":"https://api.github.com/repos/bhzunami/pytest-html/releases{/id}","deployments_url":"https://api.github.com/repos/bhzunami/pytest-html/deployments","created_at":"2016-11-11T13:31:03Z","updated_at":"2016-11-11T13:31:04Z","pushed_at":"2016-11-11T13:58:06Z","git_url":"git://github.com/bhzunami/pytest-html.git","ssh_url":"git@github.com:bhzunami/pytest-html.git","clone_url":"https://github.com/bhzunami/pytest-html.git","svn_url":"https://github.com/bhzunami/pytest-html","homepage":null,"size":160,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pytest-dev:master","ref":"master","sha":"bafc9e067d8a34f4abb5884e08798357e16f2138","user":{"login":"pytest-dev","id":8897583,"avatar_url":"https://avatars.githubusercontent.com/u/8897583?v=3","gravatar_id":"","url":"https://api.github.com/users/pytest-dev","html_url":"https://github.com/pytest-dev","followers_url":"https://api.github.com/users/pytest-dev/followers","following_url":"https://api.github.com/users/pytest-dev/following{/other_user}","gists_url":"https://api.github.com/users/pytest-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/pytest-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytest-dev/subscriptions","organizations_url":"https://api.github.com/users/pytest-dev/orgs","repos_url":"https://api.github.com/users/pytest-dev/repos","events_url":"https://api.github.com/users/pytest-dev/events{/privacy}","received_events_url":"https://api.github.com/users/pytest-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":33952074,"name":"pytest-html","full_name":"pytest-dev/pytest-html","owner":{"login":"pytest-dev","id":8897583,"avatar_url":"https://avatars.githubusercontent.com/u/8897583?v=3","gravatar_id":"","url":"https://api.github.com/users/pytest-dev","html_url":"https://github.com/pytest-dev","followers_url":"https://api.github.com/users/pytest-dev/followers","following_url":"https://api.github.com/users/pytest-dev/following{/other_user}","gists_url":"https://api.github.com/users/pytest-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/pytest-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytest-dev/subscriptions","organizations_url":"https://api.github.com/users/pytest-dev/orgs","repos_url":"https://api.github.com/users/pytest-dev/repos","events_url":"https://api.github.com/users/pytest-dev/events{/privacy}","received_events_url":"https://api.github.com/users/pytest-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pytest-dev/pytest-html","description":"Plugin for generating HTML reports for py.test results","fork":false,"url":"https://api.github.com/repos/pytest-dev/pytest-html","forks_url":"https://api.github.com/repos/pytest-dev/pytest-html/forks","keys_url":"https://api.github.com/repos/pytest-dev/pytest-html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pytest-dev/pytest-html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pytest-dev/pytest-html/teams","hooks_url":"https://api.github.com/repos/pytest-dev/pytest-html/hooks","issue_events_url":"https://api.github.com/repos/pytest-dev/pytest-html/issues/events{/number}","events_url":"https://api.github.com/repos/pytest-dev/pytest-html/events","assignees_url":"https://api.github.com/repos/pytest-dev/pytest-html/assignees{/user}","branches_url":"https://api.github.com/repos/pytest-dev/pytest-html/branches{/branch}","tags_url":"https://api.github.com/repos/pytest-dev/pytest-html/tags","blobs_url":"https://api.github.com/repos/pytest-dev/pytest-html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pytest-dev/pytest-html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pytest-dev/pytest-html/git/refs{/sha}","trees_url":"https://api.github.com/repos/pytest-dev/pytest-html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pytest-dev/pytest-html/statuses/{sha}","languages_url":"https://api.github.com/repos/pytest-dev/pytest-html/languages","stargazers_url":"https://api.github.com/repos/pytest-dev/pytest-html/stargazers","contributors_url":"https://api.github.com/repos/pytest-dev/pytest-html/contributors","subscribers_url":"https://api.github.com/repos/pytest-dev/pytest-html/subscribers","subscription_url":"https://api.github.com/repos/pytest-dev/pytest-html/subscription","commits_url":"https://api.github.com/repos/pytest-dev/pytest-html/commits{/sha}","git_commits_url":"https://api.github.com/repos/pytest-dev/pytest-html/git/commits{/sha}","comments_url":"https://api.github.com/repos/pytest-dev/pytest-html/comments{/number}","issue_comment_url":"https://api.github.com/repos/pytest-dev/pytest-html/issues/comments{/number}","contents_url":"https://api.github.com/repos/pytest-dev/pytest-html/contents/{+path}","compare_url":"https://api.github.com/repos/pytest-dev/pytest-html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pytest-dev/pytest-html/merges","archive_url":"https://api.github.com/repos/pytest-dev/pytest-html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pytest-dev/pytest-html/downloads","issues_url":"https://api.github.com/repos/pytest-dev/pytest-html/issues{/number}","pulls_url":"https://api.github.com/repos/pytest-dev/pytest-html/pulls{/number}","milestones_url":"https://api.github.com/repos/pytest-dev/pytest-html/milestones{/number}","notifications_url":"https://api.github.com/repos/pytest-dev/pytest-html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pytest-dev/pytest-html/labels{/name}","releases_url":"https://api.github.com/repos/pytest-dev/pytest-html/releases{/id}","deployments_url":"https://api.github.com/repos/pytest-dev/pytest-html/deployments","created_at":"2015-04-14T19:22:42Z","updated_at":"2016-10-29T12:43:24Z","pushed_at":"2016-11-12T13:12:16Z","git_url":"git://github.com/pytest-dev/pytest-html.git","ssh_url":"git@github.com:pytest-dev/pytest-html.git","clone_url":"https://github.com/pytest-dev/pytest-html.git","svn_url":"https://github.com/pytest-dev/pytest-html","homepage":null,"size":273,"stargazers_count":54,"watchers_count":54,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":16,"forks":36,"open_issues":16,"watchers":54,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pytest-dev/pytest-html/pulls/87"},"html":{"href":"https://github.com/pytest-dev/pytest-html/pull/87"},"issue":{"href":"https://api.github.com/repos/pytest-dev/pytest-html/issues/87"},"comments":{"href":"https://api.github.com/repos/pytest-dev/pytest-html/issues/87/comments"},"review_comments":{"href":"https://api.github.com/repos/pytest-dev/pytest-html/pulls/87/comments"},"review_comment":{"href":"https://api.github.com/repos/pytest-dev/pytest-html/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pytest-dev/pytest-html/pulls/87/commits"},"statuses":{"href":"https://api.github.com/repos/pytest-dev/pytest-html/statuses/5327f8e138cc4defbebbbcd84dbd71b6379c0284"}}}}
{"actor":{"display_login":"davehunt"}}