{"action":"created","comment":{"url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/pulls/comments/151522759","pull_request_review_id":77245698,"id":151522759,"diff_hunk":"@@ -83,25 +83,40 @@ public function getHelperProperties(MediaInterface $media, $format, $options = [\n         ];\n \n         if (MediaProviderInterface::FORMAT_ADMIN !== $format) {\n-            $srcSet = [];\n \n-            foreach ($this->getFormats() as $providerFormat => $settings) {\n-                // Check if format belongs to the current media's context\n-                if (0 === strpos($providerFormat, $media->getContext())) {\n-                    $width = $this->resizer->getBox($media, $settings)->getWidth();\n+            $srcSetFormats = $this->getFormats();\n \n-                    $srcSet[] = sprintf('%s %dw', $this->generatePublicUrl($media, $providerFormat), $width);\n+            if (isset($options['srcset']) && is_array($options['srcset'])) {","path":"src/Provider/ImageProvider.php","position":null,"original_position":13,"commit_id":"d3615ddcffbebe4eb99e7dd24a40f8285d130b33","original_commit_id":"0aa3c16e0ce2332cb8652ae2aa51feac53810e18","user":{"login":"rvanginneken","id":2691312,"avatar_url":"https://avatars0.githubusercontent.com/u/2691312?v=4","gravatar_id":"","url":"https://api.github.com/users/rvanginneken","html_url":"https://github.com/rvanginneken","followers_url":"https://api.github.com/users/rvanginneken/followers","following_url":"https://api.github.com/users/rvanginneken/following{/other_user}","gists_url":"https://api.github.com/users/rvanginneken/gists{/gist_id}","starred_url":"https://api.github.com/users/rvanginneken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvanginneken/subscriptions","organizations_url":"https://api.github.com/users/rvanginneken/orgs","repos_url":"https://api.github.com/users/rvanginneken/repos","events_url":"https://api.github.com/users/rvanginneken/events{/privacy}","received_events_url":"https://api.github.com/users/rvanginneken/received_events","type":"User","site_admin":false},"body":"Is this still something I should look into, given the answer on your other comment? I don't see an immediate benefit from implementing it now.","created_at":"2017-11-16T20:03:30Z","updated_at":"2017-11-16T20:03:30Z","html_url":"https://github.com/sonata-project/SonataMediaBundle/pull/1326#discussion_r151522759","pull_request_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/pulls/1326","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/sonata-project/SonataMediaBundle/pulls/comments/151522759"},"html":{"href":"https://github.com/sonata-project/SonataMediaBundle/pull/1326#discussion_r151522759"},"pull_request":{"href":"https://api.github.com/repos/sonata-project/SonataMediaBundle/pulls/1326"}},"in_reply_to_id":151447721},"pull_request":{"url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/pulls/1326","id":153072187,"html_url":"https://github.com/sonata-project/SonataMediaBundle/pull/1326","diff_url":"https://github.com/sonata-project/SonataMediaBundle/pull/1326.diff","patch_url":"https://github.com/sonata-project/SonataMediaBundle/pull/1326.patch","issue_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/1326","number":1326,"state":"open","locked":false,"title":"Set img srcset tag by format names","user":{"login":"rvanginneken","id":2691312,"avatar_url":"https://avatars0.githubusercontent.com/u/2691312?v=4","gravatar_id":"","url":"https://api.github.com/users/rvanginneken","html_url":"https://github.com/rvanginneken","followers_url":"https://api.github.com/users/rvanginneken/followers","following_url":"https://api.github.com/users/rvanginneken/following{/other_user}","gists_url":"https://api.github.com/users/rvanginneken/gists{/gist_id}","starred_url":"https://api.github.com/users/rvanginneken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvanginneken/subscriptions","organizations_url":"https://api.github.com/users/rvanginneken/orgs","repos_url":"https://api.github.com/users/rvanginneken/repos","events_url":"https://api.github.com/users/rvanginneken/events{/privacy}","received_events_url":"https://api.github.com/users/rvanginneken/received_events","type":"User","site_admin":false},"body":"I am targeting this branch, because this was a missing feature.\r\n\r\n```markdown\r\n### Added\r\n- Added option to set the img `srcset` tag by giving it an array of format names.\r\n```\r\n## Subject\r\n\r\nFrontend developers need the possibility to explicitly choose which formats need to be available in the srcset tag. This was currently achievable by combining the *media* tag with the *path* tag, but this is not user friendly and hardly maintainable.\r\nInstead I created the possiblity to give the srcset tag an array of format names, which will be converted to the correct URL and settings for each format.\r\n","created_at":"2017-11-16T15:32:42Z","updated_at":"2017-11-16T20:03:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6e4b6c00451796d6317fcf8bb196ff7924cba37","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/pulls/1326/commits","review_comments_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/pulls/1326/comments","review_comment_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/1326/comments","statuses_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/statuses/d3615ddcffbebe4eb99e7dd24a40f8285d130b33","head":{"label":"rvanginneken:srcset","ref":"srcset","sha":"d3615ddcffbebe4eb99e7dd24a40f8285d130b33","user":{"login":"rvanginneken","id":2691312,"avatar_url":"https://avatars0.githubusercontent.com/u/2691312?v=4","gravatar_id":"","url":"https://api.github.com/users/rvanginneken","html_url":"https://github.com/rvanginneken","followers_url":"https://api.github.com/users/rvanginneken/followers","following_url":"https://api.github.com/users/rvanginneken/following{/other_user}","gists_url":"https://api.github.com/users/rvanginneken/gists{/gist_id}","starred_url":"https://api.github.com/users/rvanginneken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvanginneken/subscriptions","organizations_url":"https://api.github.com/users/rvanginneken/orgs","repos_url":"https://api.github.com/users/rvanginneken/repos","events_url":"https://api.github.com/users/rvanginneken/events{/privacy}","received_events_url":"https://api.github.com/users/rvanginneken/received_events","type":"User","site_admin":false},"repo":{"id":110987712,"name":"SonataMediaBundle","full_name":"rvanginneken/SonataMediaBundle","owner":{"login":"rvanginneken","id":2691312,"avatar_url":"https://avatars0.githubusercontent.com/u/2691312?v=4","gravatar_id":"","url":"https://api.github.com/users/rvanginneken","html_url":"https://github.com/rvanginneken","followers_url":"https://api.github.com/users/rvanginneken/followers","following_url":"https://api.github.com/users/rvanginneken/following{/other_user}","gists_url":"https://api.github.com/users/rvanginneken/gists{/gist_id}","starred_url":"https://api.github.com/users/rvanginneken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvanginneken/subscriptions","organizations_url":"https://api.github.com/users/rvanginneken/orgs","repos_url":"https://api.github.com/users/rvanginneken/repos","events_url":"https://api.github.com/users/rvanginneken/events{/privacy}","received_events_url":"https://api.github.com/users/rvanginneken/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rvanginneken/SonataMediaBundle","description":"Media management bundle on steroid for Symfony2","fork":true,"url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle","forks_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/forks","keys_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/teams","hooks_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/hooks","issue_events_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/issues/events{/number}","events_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/events","assignees_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/assignees{/user}","branches_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/branches{/branch}","tags_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/tags","blobs_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/languages","stargazers_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/stargazers","contributors_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/contributors","subscribers_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/subscribers","subscription_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/subscription","commits_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/contents/{+path}","compare_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/merges","archive_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/downloads","issues_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/issues{/number}","pulls_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/labels{/name}","releases_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/releases{/id}","deployments_url":"https://api.github.com/repos/rvanginneken/SonataMediaBundle/deployments","created_at":"2017-11-16T15:22:41Z","updated_at":"2017-11-16T15:22:44Z","pushed_at":"2017-11-16T19:55:00Z","git_url":"git://github.com/rvanginneken/SonataMediaBundle.git","ssh_url":"git@github.com:rvanginneken/SonataMediaBundle.git","clone_url":"https://github.com/rvanginneken/SonataMediaBundle.git","svn_url":"https://github.com/rvanginneken/SonataMediaBundle","homepage":"https://sonata-project.org/","size":3405,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"3.x"}},"base":{"label":"sonata-project:3.x","ref":"3.x","sha":"5f15f604a8ec670b26d109858b2be93b695734da","user":{"login":"sonata-project","id":404157,"avatar_url":"https://avatars0.githubusercontent.com/u/404157?v=4","gravatar_id":"","url":"https://api.github.com/users/sonata-project","html_url":"https://github.com/sonata-project","followers_url":"https://api.github.com/users/sonata-project/followers","following_url":"https://api.github.com/users/sonata-project/following{/other_user}","gists_url":"https://api.github.com/users/sonata-project/gists{/gist_id}","starred_url":"https://api.github.com/users/sonata-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonata-project/subscriptions","organizations_url":"https://api.github.com/users/sonata-project/orgs","repos_url":"https://api.github.com/users/sonata-project/repos","events_url":"https://api.github.com/users/sonata-project/events{/privacy}","received_events_url":"https://api.github.com/users/sonata-project/received_events","type":"Organization","site_admin":false},"repo":{"id":1059291,"name":"SonataMediaBundle","full_name":"sonata-project/SonataMediaBundle","owner":{"login":"sonata-project","id":404157,"avatar_url":"https://avatars0.githubusercontent.com/u/404157?v=4","gravatar_id":"","url":"https://api.github.com/users/sonata-project","html_url":"https://github.com/sonata-project","followers_url":"https://api.github.com/users/sonata-project/followers","following_url":"https://api.github.com/users/sonata-project/following{/other_user}","gists_url":"https://api.github.com/users/sonata-project/gists{/gist_id}","starred_url":"https://api.github.com/users/sonata-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonata-project/subscriptions","organizations_url":"https://api.github.com/users/sonata-project/orgs","repos_url":"https://api.github.com/users/sonata-project/repos","events_url":"https://api.github.com/users/sonata-project/events{/privacy}","received_events_url":"https://api.github.com/users/sonata-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sonata-project/SonataMediaBundle","description":"Media management bundle on steroid for Symfony2","fork":false,"url":"https://api.github.com/repos/sonata-project/SonataMediaBundle","forks_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/forks","keys_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/teams","hooks_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/hooks","issue_events_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/events{/number}","events_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/events","assignees_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/assignees{/user}","branches_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/branches{/branch}","tags_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/tags","blobs_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/languages","stargazers_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/stargazers","contributors_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/contributors","subscribers_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/subscribers","subscription_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/subscription","commits_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/contents/{+path}","compare_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/merges","archive_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/downloads","issues_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues{/number}","pulls_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/labels{/name}","releases_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/releases{/id}","deployments_url":"https://api.github.com/repos/sonata-project/SonataMediaBundle/deployments","created_at":"2010-11-07T14:41:46Z","updated_at":"2017-11-13T03:12:34Z","pushed_at":"2017-11-16T19:55:02Z","git_url":"git://github.com/sonata-project/SonataMediaBundle.git","ssh_url":"git@github.com:sonata-project/SonataMediaBundle.git","clone_url":"https://github.com/sonata-project/SonataMediaBundle.git","svn_url":"https://github.com/sonata-project/SonataMediaBundle","homepage":"https://sonata-project.org/","size":3404,"stargazers_count":329,"watchers_count":329,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":430,"mirror_url":null,"archived":false,"open_issues_count":121,"forks":430,"open_issues":121,"watchers":329,"default_branch":"3.x"}},"_links":{"self":{"href":"https://api.github.com/repos/sonata-project/SonataMediaBundle/pulls/1326"},"html":{"href":"https://github.com/sonata-project/SonataMediaBundle/pull/1326"},"issue":{"href":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/1326"},"comments":{"href":"https://api.github.com/repos/sonata-project/SonataMediaBundle/issues/1326/comments"},"review_comments":{"href":"https://api.github.com/repos/sonata-project/SonataMediaBundle/pulls/1326/comments"},"review_comment":{"href":"https://api.github.com/repos/sonata-project/SonataMediaBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sonata-project/SonataMediaBundle/pulls/1326/commits"},"statuses":{"href":"https://api.github.com/repos/sonata-project/SonataMediaBundle/statuses/d3615ddcffbebe4eb99e7dd24a40f8285d130b33"}},"author_association":"NONE"}}
{"actor":{"display_login":"rvanginneken"}}