{"action":"created","comment":{"url":"https://api.github.com/repos/guardian/frontend/pulls/comments/62667894","id":62667894,"diff_hunk":"@@ -10,6 +10,19 @@\n     isImmersiveMainMedia: Boolean = false\n )\n \n+@immersivePortraitSource(largestImage: model.ImageAsset, hidpi: Boolean = false) = {\n+    <source media=\"@if(hidpi) {\n+        (orientation: portrait) and (-webkit-min-device-pixel-ratio: 1.25), (orientation: portrait) and (min-resolution: 120dpi)\n+    } else {\n+        (orientation: portrait)\n+    }\"\n+    sizes=\"@{100 * (largestImage.width.toDouble / largestImage.height.toDouble)}vh\"","path":"common/app/views/fragments/image.scala.html","position":10,"original_position":10,"commit_id":"d2bb74d8cf51ea972f9ab784d9a246b82a760fec","original_commit_id":"d2bb74d8cf51ea972f9ab784d9a246b82a760fec","user":{"login":"rich-nguyen","id":4549425,"avatar_url":"https://avatars.githubusercontent.com/u/4549425?v=3","gravatar_id":"","url":"https://api.github.com/users/rich-nguyen","html_url":"https://github.com/rich-nguyen","followers_url":"https://api.github.com/users/rich-nguyen/followers","following_url":"https://api.github.com/users/rich-nguyen/following{/other_user}","gists_url":"https://api.github.com/users/rich-nguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/rich-nguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rich-nguyen/subscriptions","organizations_url":"https://api.github.com/users/rich-nguyen/orgs","repos_url":"https://api.github.com/users/rich-nguyen/repos","events_url":"https://api.github.com/users/rich-nguyen/events{/privacy}","received_events_url":"https://api.github.com/users/rich-nguyen/received_events","type":"User","site_admin":false},"body":"Should this be a whole number?","created_at":"2016-05-10T13:11:55Z","updated_at":"2016-05-10T13:11:55Z","html_url":"https://github.com/guardian/frontend/pull/12811#discussion_r62667894","pull_request_url":"https://api.github.com/repos/guardian/frontend/pulls/12811","_links":{"self":{"href":"https://api.github.com/repos/guardian/frontend/pulls/comments/62667894"},"html":{"href":"https://github.com/guardian/frontend/pull/12811#discussion_r62667894"},"pull_request":{"href":"https://api.github.com/repos/guardian/frontend/pulls/12811"}}},"pull_request":{"url":"https://api.github.com/repos/guardian/frontend/pulls/12811","id":69163186,"html_url":"https://github.com/guardian/frontend/pull/12811","diff_url":"https://github.com/guardian/frontend/pull/12811.diff","patch_url":"https://github.com/guardian/frontend/pull/12811.patch","issue_url":"https://api.github.com/repos/guardian/frontend/issues/12811","number":12811,"state":"closed","locked":false,"title":"New galleries: improve main media quality for portrait devices","user":{"login":"OliverJAsh","id":921609,"avatar_url":"https://avatars.githubusercontent.com/u/921609?v=3","gravatar_id":"","url":"https://api.github.com/users/OliverJAsh","html_url":"https://github.com/OliverJAsh","followers_url":"https://api.github.com/users/OliverJAsh/followers","following_url":"https://api.github.com/users/OliverJAsh/following{/other_user}","gists_url":"https://api.github.com/users/OliverJAsh/gists{/gist_id}","starred_url":"https://api.github.com/users/OliverJAsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OliverJAsh/subscriptions","organizations_url":"https://api.github.com/users/OliverJAsh/orgs","repos_url":"https://api.github.com/users/OliverJAsh/repos","events_url":"https://api.github.com/users/OliverJAsh/events{/privacy}","received_events_url":"https://api.github.com/users/OliverJAsh/received_events","type":"User","site_admin":false},"body":"When the device is in portrait orientation, we want to constrain the image by height rather than width. As `sizes` only allows widths and not heights, I'm using the technique described at http://codepen.io/tigt/post/when-responsive-images-get-ugly#height-and-width-constrained-srcset\r\n\r\n# Before\r\n![image](https://cloud.githubusercontent.com/assets/921609/15076773/372be3de-13a3-11e6-9519-784ec360fc68.png)\r\n\r\n# After\r\n![image](https://cloud.githubusercontent.com/assets/921609/15076777/3c2369f2-13a3-11e6-8683-bd46b761b85b.png)\r\n\r\n# To do\r\n- [x] Replace media query with `orientation: portrait`?\r\n- [x] Update media query for hidpi\r\n\r\n/cc @NataliaLKB @paperboyo","created_at":"2016-05-06T14:58:42Z","updated_at":"2016-05-10T13:11:55Z","closed_at":"2016-05-10T10:31:01Z","merged_at":"2016-05-10T10:31:01Z","merge_commit_sha":"56d80e77c35529afabd75bdeed433ed5d4073e57","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/guardian/frontend/pulls/12811/commits","review_comments_url":"https://api.github.com/repos/guardian/frontend/pulls/12811/comments","review_comment_url":"https://api.github.com/repos/guardian/frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guardian/frontend/issues/12811/comments","statuses_url":"https://api.github.com/repos/guardian/frontend/statuses/d2bb74d8cf51ea972f9ab784d9a246b82a760fec","head":{"label":"guardian:oja-gallery-main-media-quality","ref":"oja-gallery-main-media-quality","sha":"d2bb74d8cf51ea972f9ab784d9a246b82a760fec","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":4370755,"name":"frontend","full_name":"guardian/frontend","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/frontend","description":"Source for theguardian.com","fork":false,"url":"https://api.github.com/repos/guardian/frontend","forks_url":"https://api.github.com/repos/guardian/frontend/forks","keys_url":"https://api.github.com/repos/guardian/frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/frontend/teams","hooks_url":"https://api.github.com/repos/guardian/frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/frontend/events","assignees_url":"https://api.github.com/repos/guardian/frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/frontend/tags","blobs_url":"https://api.github.com/repos/guardian/frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/frontend/subscription","commits_url":"https://api.github.com/repos/guardian/frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/frontend/merges","archive_url":"https://api.github.com/repos/guardian/frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/frontend/downloads","issues_url":"https://api.github.com/repos/guardian/frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/frontend/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/frontend/deployments","created_at":"2012-05-18T15:39:15Z","updated_at":"2016-05-10T11:53:16Z","pushed_at":"2016-05-10T13:09:01Z","git_url":"git://github.com/guardian/frontend.git","ssh_url":"git@github.com:guardian/frontend.git","clone_url":"https://github.com/guardian/frontend.git","svn_url":"https://github.com/guardian/frontend","homepage":"http://www.theguardian.com","size":472253,"stargazers_count":3195,"watchers_count":3195,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":334,"mirror_url":null,"open_issues_count":43,"forks":334,"open_issues":43,"watchers":3195,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"3a50f4183f8ee63bb595e9665512384eaf773be1","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":4370755,"name":"frontend","full_name":"guardian/frontend","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/frontend","description":"Source for theguardian.com","fork":false,"url":"https://api.github.com/repos/guardian/frontend","forks_url":"https://api.github.com/repos/guardian/frontend/forks","keys_url":"https://api.github.com/repos/guardian/frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/frontend/teams","hooks_url":"https://api.github.com/repos/guardian/frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/frontend/events","assignees_url":"https://api.github.com/repos/guardian/frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/frontend/tags","blobs_url":"https://api.github.com/repos/guardian/frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/frontend/subscription","commits_url":"https://api.github.com/repos/guardian/frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/frontend/merges","archive_url":"https://api.github.com/repos/guardian/frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/frontend/downloads","issues_url":"https://api.github.com/repos/guardian/frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/frontend/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/frontend/deployments","created_at":"2012-05-18T15:39:15Z","updated_at":"2016-05-10T11:53:16Z","pushed_at":"2016-05-10T13:09:01Z","git_url":"git://github.com/guardian/frontend.git","ssh_url":"git@github.com:guardian/frontend.git","clone_url":"https://github.com/guardian/frontend.git","svn_url":"https://github.com/guardian/frontend","homepage":"http://www.theguardian.com","size":472253,"stargazers_count":3195,"watchers_count":3195,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":334,"mirror_url":null,"open_issues_count":43,"forks":334,"open_issues":43,"watchers":3195,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/frontend/pulls/12811"},"html":{"href":"https://github.com/guardian/frontend/pull/12811"},"issue":{"href":"https://api.github.com/repos/guardian/frontend/issues/12811"},"comments":{"href":"https://api.github.com/repos/guardian/frontend/issues/12811/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/frontend/pulls/12811/comments"},"review_comment":{"href":"https://api.github.com/repos/guardian/frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guardian/frontend/pulls/12811/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/frontend/statuses/d2bb74d8cf51ea972f9ab784d9a246b82a760fec"}}}}