{"action":"created","issue":{"url":"https://api.github.com/repos/piwik/piwik/issues/9371","labels_url":"https://api.github.com/repos/piwik/piwik/issues/9371/labels{/name}","comments_url":"https://api.github.com/repos/piwik/piwik/issues/9371/comments","events_url":"https://api.github.com/repos/piwik/piwik/issues/9371/events","html_url":"https://github.com/piwik/piwik/issues/9371","id":121326700,"number":9371,"title":"Wrong display resolution (Android)","user":{"login":"jsmad","id":279256,"avatar_url":"https://avatars.githubusercontent.com/u/279256?v=3","gravatar_id":"","url":"https://api.github.com/users/jsmad","html_url":"https://github.com/jsmad","followers_url":"https://api.github.com/users/jsmad/followers","following_url":"https://api.github.com/users/jsmad/following{/other_user}","gists_url":"https://api.github.com/users/jsmad/gists{/gist_id}","starred_url":"https://api.github.com/users/jsmad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsmad/subscriptions","organizations_url":"https://api.github.com/users/jsmad/orgs","repos_url":"https://api.github.com/users/jsmad/repos","events_url":"https://api.github.com/users/jsmad/events{/privacy}","received_events_url":"https://api.github.com/users/jsmad/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/piwik/piwik/labels/Bug","name":"Bug","color":"fc2929"},{"url":"https://api.github.com/repos/piwik/piwik/labels/Easy%20pick","name":"Easy pick","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-09T20:02:59Z","updated_at":"2015-12-09T21:51:05Z","closed_at":null,"body":"I've noticed many resolutions are reported wrongly, mainly for Android devices. I'm not sure if this is due to a bug in piwik, or if its due to a fake browser on the client side.\r\n\r\nFor example, this displays the correct resolution (1280x800):\r\n\r\n(user agent)\r\n```\r\n\"Mozilla/5.0 (Linux; Android 4.4.2; IQ1010 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.76 Safari/537.36\"\r\n```\r\n(piwik.php parameter)\r\n```\r\n&res=1280x800\r\n```\r\n\r\nBut...\r\n\r\nThis displays an invalid resolution (800.08129 ?!?!):\r\n\r\n(user agent)\r\n```\r\n\"Mozilla/5.0 (Linux; Android 4.4.2; Lenovo A5500-H Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36\"\r\n```\r\n(piwik.php parameter)\r\n```\r\n&res=800.0812929868698x1216.7625653743744\r\n```\r\n\r\nLooks like there is a rounding error?\r\n"},"comment":{"url":"https://api.github.com/repos/piwik/piwik/issues/comments/163405439","html_url":"https://github.com/piwik/piwik/issues/9371#issuecomment-163405439","issue_url":"https://api.github.com/repos/piwik/piwik/issues/9371","id":163405439,"user":{"login":"tsteur","id":273120,"avatar_url":"https://avatars.githubusercontent.com/u/273120?v=3","gravatar_id":"","url":"https://api.github.com/users/tsteur","html_url":"https://github.com/tsteur","followers_url":"https://api.github.com/users/tsteur/followers","following_url":"https://api.github.com/users/tsteur/following{/other_user}","gists_url":"https://api.github.com/users/tsteur/gists{/gist_id}","starred_url":"https://api.github.com/users/tsteur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsteur/subscriptions","organizations_url":"https://api.github.com/users/tsteur/orgs","repos_url":"https://api.github.com/users/tsteur/repos","events_url":"https://api.github.com/users/tsteur/events{/privacy}","received_events_url":"https://api.github.com/users/tsteur/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T21:51:05Z","updated_at":"2015-12-09T21:51:05Z","body":"We could definitely do something there as it is easy to do. I'd suggest something like \r\n\r\n```js\r\ndevicePixelRatio = parseFloat(devicePixelRatio).toFixed(3); // I think we could even do \"devicePixelRatio.toFixed(2)\" but better we make sure to work with int or float. Maybe we would do it only if it already is a float and not an \"int\"\r\nvar width = parseInt(screenAlias.width,10) * devicePixelRatio;\r\nvar height = parseInt(screenAlias.height, 10) * devicePixelRatio;\r\nbrowserFeatures.res = parseInt(width, 10) + 'x' + parseInt(height, 10);\r\n```"}}