{"action":"created","comment":{"url":"https://api.github.com/repos/mumble-voip/mumble/pulls/comments/61686463","id":61686463,"diff_hunk":"@@ -333,35 +333,38 @@ void Log::clearIgnore() {\n \tqmIgnore.clear();\n }\n \n+/// Estimate the size of buf when encoded as an HTML image tag\n+/// with the src attribute set to a base64-encoded data URL, such\n+/// as:\n+///\n+///    <img src=\"image/jpeg;base64,[base64-of-buf-goes-here]\" />\n+///\n+static unsigned int estimatedDataURLImageSize(const QByteArray &buf) {\n+    // We estimate the extra characters (HTML) in the encoded\n+    // message to be around 64.\n+    const unsigned int htmlExtras = 64U;","path":"src/mumble/Log.cpp","position":13,"original_position":13,"commit_id":"f3a43d73aa581898949da09c0cf911c18b0ec2fd","original_commit_id":"f3a43d73aa581898949da09c0cf911c18b0ec2fd","user":{"login":"bontibon","id":110883,"avatar_url":"https://avatars.githubusercontent.com/u/110883?v=3","gravatar_id":"","url":"https://api.github.com/users/bontibon","html_url":"https://github.com/bontibon","followers_url":"https://api.github.com/users/bontibon/followers","following_url":"https://api.github.com/users/bontibon/following{/other_user}","gists_url":"https://api.github.com/users/bontibon/gists{/gist_id}","starred_url":"https://api.github.com/users/bontibon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bontibon/subscriptions","organizations_url":"https://api.github.com/users/bontibon/orgs","repos_url":"https://api.github.com/users/bontibon/repos","events_url":"https://api.github.com/users/bontibon/events{/privacy}","received_events_url":"https://api.github.com/users/bontibon/received_events","type":"User","site_admin":false},"body":"If we calculate the exact size required, there is the possibility that the user will have no more space to type a message after inserting the image. Of course, the current value of `htmlExtras` only gives them a few more characters anyway.\r\n\r\nIn an ideal packing function, the user would insert all of the images/text that he wants into the text message first, then when he hits send, the images are compressed as necessary.","created_at":"2016-05-01T12:25:19Z","updated_at":"2016-05-01T12:25:19Z","html_url":"https://github.com/mumble-voip/mumble/pull/2229#discussion_r61686463","pull_request_url":"https://api.github.com/repos/mumble-voip/mumble/pulls/2229","_links":{"self":{"href":"https://api.github.com/repos/mumble-voip/mumble/pulls/comments/61686463"},"html":{"href":"https://github.com/mumble-voip/mumble/pull/2229#discussion_r61686463"},"pull_request":{"href":"https://api.github.com/repos/mumble-voip/mumble/pulls/2229"}}},"pull_request":{"url":"https://api.github.com/repos/mumble-voip/mumble/pulls/2229","id":68468153,"html_url":"https://github.com/mumble-voip/mumble/pull/2229","diff_url":"https://github.com/mumble-voip/mumble/pull/2229.diff","patch_url":"https://github.com/mumble-voip/mumble/pull/2229.patch","issue_url":"https://api.github.com/repos/mumble-voip/mumble/issues/2229","number":2229,"state":"open","locked":false,"title":"make image inserting consistent between clipboard and file selection","user":{"login":"bontibon","id":110883,"avatar_url":"https://avatars.githubusercontent.com/u/110883?v=3","gravatar_id":"","url":"https://api.github.com/users/bontibon","html_url":"https://github.com/bontibon","followers_url":"https://api.github.com/users/bontibon/followers","following_url":"https://api.github.com/users/bontibon/following{/other_user}","gists_url":"https://api.github.com/users/bontibon/gists{/gist_id}","starred_url":"https://api.github.com/users/bontibon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bontibon/subscriptions","organizations_url":"https://api.github.com/users/bontibon/orgs","repos_url":"https://api.github.com/users/bontibon/repos","events_url":"https://api.github.com/users/bontibon/events{/privacy}","received_events_url":"https://api.github.com/users/bontibon/received_events","type":"User","site_admin":false},"body":"Previously, images inserted from the clipboard would follow a different\r\npath than images inserted via the file selection. Clipboard images were\r\nrestricted to a maximum dimensions of 480x270, where file selection images\r\nwere restricted based on their their size in bytes (comparing to the\r\nserver's limit). Additionally, only images from the clipboard would have\r\ntheir quality reduced in order to reduce image size.\r\n\r\nImages now posted from either source will not have a dimension restriction,\r\nand will have their quality reduced, as necessary, to fit into the\r\nserver's limit.","created_at":"2016-04-30T13:37:21Z","updated_at":"2016-05-01T12:25:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c552e8e1afad22df2cdf4c85f0e84ffd0b2626fe","assignee":{"login":"mkrautz","id":36527,"avatar_url":"https://avatars.githubusercontent.com/u/36527?v=3","gravatar_id":"","url":"https://api.github.com/users/mkrautz","html_url":"https://github.com/mkrautz","followers_url":"https://api.github.com/users/mkrautz/followers","following_url":"https://api.github.com/users/mkrautz/following{/other_user}","gists_url":"https://api.github.com/users/mkrautz/gists{/gist_id}","starred_url":"https://api.github.com/users/mkrautz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkrautz/subscriptions","organizations_url":"https://api.github.com/users/mkrautz/orgs","repos_url":"https://api.github.com/users/mkrautz/repos","events_url":"https://api.github.com/users/mkrautz/events{/privacy}","received_events_url":"https://api.github.com/users/mkrautz/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mumble-voip/mumble/pulls/2229/commits","review_comments_url":"https://api.github.com/repos/mumble-voip/mumble/pulls/2229/comments","review_comment_url":"https://api.github.com/repos/mumble-voip/mumble/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mumble-voip/mumble/issues/2229/comments","statuses_url":"https://api.github.com/repos/mumble-voip/mumble/statuses/f3a43d73aa581898949da09c0cf911c18b0ec2fd","head":{"label":"bontibon:rte-image-resize","ref":"rte-image-resize","sha":"f3a43d73aa581898949da09c0cf911c18b0ec2fd","user":{"login":"bontibon","id":110883,"avatar_url":"https://avatars.githubusercontent.com/u/110883?v=3","gravatar_id":"","url":"https://api.github.com/users/bontibon","html_url":"https://github.com/bontibon","followers_url":"https://api.github.com/users/bontibon/followers","following_url":"https://api.github.com/users/bontibon/following{/other_user}","gists_url":"https://api.github.com/users/bontibon/gists{/gist_id}","starred_url":"https://api.github.com/users/bontibon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bontibon/subscriptions","organizations_url":"https://api.github.com/users/bontibon/orgs","repos_url":"https://api.github.com/users/bontibon/repos","events_url":"https://api.github.com/users/bontibon/events{/privacy}","received_events_url":"https://api.github.com/users/bontibon/received_events","type":"User","site_admin":false},"repo":{"id":18245666,"name":"mumble","full_name":"bontibon/mumble","owner":{"login":"bontibon","id":110883,"avatar_url":"https://avatars.githubusercontent.com/u/110883?v=3","gravatar_id":"","url":"https://api.github.com/users/bontibon","html_url":"https://github.com/bontibon","followers_url":"https://api.github.com/users/bontibon/followers","following_url":"https://api.github.com/users/bontibon/following{/other_user}","gists_url":"https://api.github.com/users/bontibon/gists{/gist_id}","starred_url":"https://api.github.com/users/bontibon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bontibon/subscriptions","organizations_url":"https://api.github.com/users/bontibon/orgs","repos_url":"https://api.github.com/users/bontibon/repos","events_url":"https://api.github.com/users/bontibon/events{/privacy}","received_events_url":"https://api.github.com/users/bontibon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bontibon/mumble","description":"Mumble VoIP Client/Server","fork":true,"url":"https://api.github.com/repos/bontibon/mumble","forks_url":"https://api.github.com/repos/bontibon/mumble/forks","keys_url":"https://api.github.com/repos/bontibon/mumble/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bontibon/mumble/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bontibon/mumble/teams","hooks_url":"https://api.github.com/repos/bontibon/mumble/hooks","issue_events_url":"https://api.github.com/repos/bontibon/mumble/issues/events{/number}","events_url":"https://api.github.com/repos/bontibon/mumble/events","assignees_url":"https://api.github.com/repos/bontibon/mumble/assignees{/user}","branches_url":"https://api.github.com/repos/bontibon/mumble/branches{/branch}","tags_url":"https://api.github.com/repos/bontibon/mumble/tags","blobs_url":"https://api.github.com/repos/bontibon/mumble/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bontibon/mumble/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bontibon/mumble/git/refs{/sha}","trees_url":"https://api.github.com/repos/bontibon/mumble/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bontibon/mumble/statuses/{sha}","languages_url":"https://api.github.com/repos/bontibon/mumble/languages","stargazers_url":"https://api.github.com/repos/bontibon/mumble/stargazers","contributors_url":"https://api.github.com/repos/bontibon/mumble/contributors","subscribers_url":"https://api.github.com/repos/bontibon/mumble/subscribers","subscription_url":"https://api.github.com/repos/bontibon/mumble/subscription","commits_url":"https://api.github.com/repos/bontibon/mumble/commits{/sha}","git_commits_url":"https://api.github.com/repos/bontibon/mumble/git/commits{/sha}","comments_url":"https://api.github.com/repos/bontibon/mumble/comments{/number}","issue_comment_url":"https://api.github.com/repos/bontibon/mumble/issues/comments{/number}","contents_url":"https://api.github.com/repos/bontibon/mumble/contents/{+path}","compare_url":"https://api.github.com/repos/bontibon/mumble/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bontibon/mumble/merges","archive_url":"https://api.github.com/repos/bontibon/mumble/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bontibon/mumble/downloads","issues_url":"https://api.github.com/repos/bontibon/mumble/issues{/number}","pulls_url":"https://api.github.com/repos/bontibon/mumble/pulls{/number}","milestones_url":"https://api.github.com/repos/bontibon/mumble/milestones{/number}","notifications_url":"https://api.github.com/repos/bontibon/mumble/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bontibon/mumble/labels{/name}","releases_url":"https://api.github.com/repos/bontibon/mumble/releases{/id}","deployments_url":"https://api.github.com/repos/bontibon/mumble/deployments","created_at":"2014-03-29T16:49:07Z","updated_at":"2016-01-13T02:16:02Z","pushed_at":"2016-05-01T12:18:23Z","git_url":"git://github.com/bontibon/mumble.git","ssh_url":"git@github.com:bontibon/mumble.git","clone_url":"https://github.com/bontibon/mumble.git","svn_url":"https://github.com/bontibon/mumble","homepage":"http://mumble.info","size":33307,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"grpc"}},"base":{"label":"mumble-voip:master","ref":"master","sha":"b7271c2091196c1276af70274c4e0e505daf644b","user":{"login":"mumble-voip","id":639008,"avatar_url":"https://avatars.githubusercontent.com/u/639008?v=3","gravatar_id":"","url":"https://api.github.com/users/mumble-voip","html_url":"https://github.com/mumble-voip","followers_url":"https://api.github.com/users/mumble-voip/followers","following_url":"https://api.github.com/users/mumble-voip/following{/other_user}","gists_url":"https://api.github.com/users/mumble-voip/gists{/gist_id}","starred_url":"https://api.github.com/users/mumble-voip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mumble-voip/subscriptions","organizations_url":"https://api.github.com/users/mumble-voip/orgs","repos_url":"https://api.github.com/users/mumble-voip/repos","events_url":"https://api.github.com/users/mumble-voip/events{/privacy}","received_events_url":"https://api.github.com/users/mumble-voip/received_events","type":"Organization","site_admin":false},"repo":{"id":1413319,"name":"mumble","full_name":"mumble-voip/mumble","owner":{"login":"mumble-voip","id":639008,"avatar_url":"https://avatars.githubusercontent.com/u/639008?v=3","gravatar_id":"","url":"https://api.github.com/users/mumble-voip","html_url":"https://github.com/mumble-voip","followers_url":"https://api.github.com/users/mumble-voip/followers","following_url":"https://api.github.com/users/mumble-voip/following{/other_user}","gists_url":"https://api.github.com/users/mumble-voip/gists{/gist_id}","starred_url":"https://api.github.com/users/mumble-voip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mumble-voip/subscriptions","organizations_url":"https://api.github.com/users/mumble-voip/orgs","repos_url":"https://api.github.com/users/mumble-voip/repos","events_url":"https://api.github.com/users/mumble-voip/events{/privacy}","received_events_url":"https://api.github.com/users/mumble-voip/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mumble-voip/mumble","description":"Mumble VoIP Client/Server","fork":false,"url":"https://api.github.com/repos/mumble-voip/mumble","forks_url":"https://api.github.com/repos/mumble-voip/mumble/forks","keys_url":"https://api.github.com/repos/mumble-voip/mumble/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mumble-voip/mumble/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mumble-voip/mumble/teams","hooks_url":"https://api.github.com/repos/mumble-voip/mumble/hooks","issue_events_url":"https://api.github.com/repos/mumble-voip/mumble/issues/events{/number}","events_url":"https://api.github.com/repos/mumble-voip/mumble/events","assignees_url":"https://api.github.com/repos/mumble-voip/mumble/assignees{/user}","branches_url":"https://api.github.com/repos/mumble-voip/mumble/branches{/branch}","tags_url":"https://api.github.com/repos/mumble-voip/mumble/tags","blobs_url":"https://api.github.com/repos/mumble-voip/mumble/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mumble-voip/mumble/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mumble-voip/mumble/git/refs{/sha}","trees_url":"https://api.github.com/repos/mumble-voip/mumble/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mumble-voip/mumble/statuses/{sha}","languages_url":"https://api.github.com/repos/mumble-voip/mumble/languages","stargazers_url":"https://api.github.com/repos/mumble-voip/mumble/stargazers","contributors_url":"https://api.github.com/repos/mumble-voip/mumble/contributors","subscribers_url":"https://api.github.com/repos/mumble-voip/mumble/subscribers","subscription_url":"https://api.github.com/repos/mumble-voip/mumble/subscription","commits_url":"https://api.github.com/repos/mumble-voip/mumble/commits{/sha}","git_commits_url":"https://api.github.com/repos/mumble-voip/mumble/git/commits{/sha}","comments_url":"https://api.github.com/repos/mumble-voip/mumble/comments{/number}","issue_comment_url":"https://api.github.com/repos/mumble-voip/mumble/issues/comments{/number}","contents_url":"https://api.github.com/repos/mumble-voip/mumble/contents/{+path}","compare_url":"https://api.github.com/repos/mumble-voip/mumble/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mumble-voip/mumble/merges","archive_url":"https://api.github.com/repos/mumble-voip/mumble/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mumble-voip/mumble/downloads","issues_url":"https://api.github.com/repos/mumble-voip/mumble/issues{/number}","pulls_url":"https://api.github.com/repos/mumble-voip/mumble/pulls{/number}","milestones_url":"https://api.github.com/repos/mumble-voip/mumble/milestones{/number}","notifications_url":"https://api.github.com/repos/mumble-voip/mumble/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mumble-voip/mumble/labels{/name}","releases_url":"https://api.github.com/repos/mumble-voip/mumble/releases{/id}","deployments_url":"https://api.github.com/repos/mumble-voip/mumble/deployments","created_at":"2011-02-26T01:30:08Z","updated_at":"2016-04-30T18:42:05Z","pushed_at":"2016-05-01T12:18:24Z","git_url":"git://github.com/mumble-voip/mumble.git","ssh_url":"git@github.com:mumble-voip/mumble.git","clone_url":"https://github.com/mumble-voip/mumble.git","svn_url":"https://github.com/mumble-voip/mumble","homepage":"http://www.mumble.info","size":40467,"stargazers_count":1257,"watchers_count":1257,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":392,"mirror_url":null,"open_issues_count":515,"forks":392,"open_issues":515,"watchers":1257,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mumble-voip/mumble/pulls/2229"},"html":{"href":"https://github.com/mumble-voip/mumble/pull/2229"},"issue":{"href":"https://api.github.com/repos/mumble-voip/mumble/issues/2229"},"comments":{"href":"https://api.github.com/repos/mumble-voip/mumble/issues/2229/comments"},"review_comments":{"href":"https://api.github.com/repos/mumble-voip/mumble/pulls/2229/comments"},"review_comment":{"href":"https://api.github.com/repos/mumble-voip/mumble/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mumble-voip/mumble/pulls/2229/commits"},"statuses":{"href":"https://api.github.com/repos/mumble-voip/mumble/statuses/f3a43d73aa581898949da09c0cf911c18b0ec2fd"}}}}