{"action":"created","comment":{"url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/comments/167358443","pull_request_review_id":95577726,"id":167358443,"diff_hunk":"@@ -25,7 +30,11 @@\n         this.trigger('update');\n       },\n       render: function() {\n-        this.$el.attr('src', this.dataUrl);\n+        if (this.source == null) {","path":"js/views/attachment_view.js","position":null,"original_position":21,"commit_id":"d8baa707d6cec3c864c6a88500ba06cb4d133d0a","original_commit_id":"1140db8d4a592d3645c5831d02f1d29099e5db86","user":{"login":"gasi","id":49583,"avatar_url":"https://avatars3.githubusercontent.com/u/49583?v=4","gravatar_id":"","url":"https://api.github.com/users/gasi","html_url":"https://github.com/gasi","followers_url":"https://api.github.com/users/gasi/followers","following_url":"https://api.github.com/users/gasi/following{/other_user}","gists_url":"https://api.github.com/users/gasi/gists{/gist_id}","starred_url":"https://api.github.com/users/gasi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gasi/subscriptions","organizations_url":"https://api.github.com/users/gasi/orgs","repos_url":"https://api.github.com/users/gasi/repos","events_url":"https://api.github.com/users/gasi/events{/privacy}","received_events_url":"https://api.github.com/users/gasi/received_events","type":"User","site_admin":false},"body":"Yep! Fixed it in https://github.com/signalapp/Signal-Desktop/pull/2040/commits/161f759b9ccfb74b94c8cadcda5e0ca19f216edd. ESLint has a good `smart` option for `eqeqeq` rule as `typeof x === 'undefined' || x === null` can be safely shortened to `x == null`. I’ve just been bitten by automatic type coercions in the past so I err on the side of making them explicit.","created_at":"2018-02-09T22:06:17Z","updated_at":"2018-02-09T22:06:17Z","html_url":"https://github.com/signalapp/Signal-Desktop/pull/2040#discussion_r167358443","pull_request_url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2040","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/comments/167358443"},"html":{"href":"https://github.com/signalapp/Signal-Desktop/pull/2040#discussion_r167358443"},"pull_request":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2040"}},"in_reply_to_id":167347888},"pull_request":{"url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2040","id":168337388,"html_url":"https://github.com/signalapp/Signal-Desktop/pull/2040","diff_url":"https://github.com/signalapp/Signal-Desktop/pull/2040.diff","patch_url":"https://github.com/signalapp/Signal-Desktop/pull/2040.patch","issue_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/2040","number":2040,"state":"open","locked":false,"title":"WIP: Auto-orient images based on EXIF metadata","user":{"login":"gasi","id":49583,"avatar_url":"https://avatars3.githubusercontent.com/u/49583?v=4","gravatar_id":"","url":"https://api.github.com/users/gasi","html_url":"https://github.com/gasi","followers_url":"https://api.github.com/users/gasi/followers","following_url":"https://api.github.com/users/gasi/following{/other_user}","gists_url":"https://api.github.com/users/gasi/gists{/gist_id}","starred_url":"https://api.github.com/users/gasi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gasi/subscriptions","organizations_url":"https://api.github.com/users/gasi/orgs","repos_url":"https://api.github.com/users/gasi/repos","events_url":"https://api.github.com/users/gasi/events{/privacy}","received_events_url":"https://api.github.com/users/gasi/received_events","type":"User","site_admin":false},"body":"### Description\r\n\r\nAs described in #998, images are sometimes displayed with an incorrect orientation. This is because cameras often write files in the native sensor byte order and attach the `Orientation` EXIF metadata to tell end-user devices how to display the images based on the original author’s capture orientation.\r\n\r\nElectron/Chromium (and therefore Signal Desktop) currently doesn’t support applying this metadata for `<img>` tags, e.g. CSS `image-orientation: from-image`. As a workaround, this change uses the `loadImage` library with the `orientation: true` flag to auto-orient images before display.\r\n\r\n**TODO**\r\n- [x] Auto-orient images during display in message list view\r\n  - [ ] Ensure image is not displayed until loaded (to prevent layout reflow) \r\n- [ ] Auto-orient images upon receipt and before storing in IndexedDB (or preserve original data until Chromium offers native fix?)\r\n- [x] Auto-orient images in compose area preview\r\n\r\n---\r\n\r\nFixes #998 \r\n\r\n--- \r\n\r\n#### Related\r\n\r\n- **Blog:** EXIF Orientation Handling Is a Ghetto:  https://www.daveperrett.com/articles/2012/07/28/exif-orientation-handling-is-a-ghetto/\r\n- **Chromium Bug:** EXIF orientation is ignored: https://bugs.chromium.org/p/chromium/issues/detail?id=56845\r\n- **Chromium Bug:** Support for the CSS image-orientation CSS property: https://bugs.chromium.org/p/chromium/issues/detail?id=158753\r\n\r\n<!--\r\nDescribe briefly what your pull request changes. Focus on the value provided to users.\r\n\r\nDoes it address any outstanding issues in this project?\r\n  https://github.com/WhisperSystems/Signal-Desktop/issues?utf8=%E2%9C%93&q=is%3Aissue\r\n  Reference an issue with the hash symbol: \"#222\"\r\n  If you're fixing it, use something like \"Fixes #222\"\r\n\r\nPlease write a summary of your test approach:\r\n  - What kind of manual testing did you do?\r\n  - Did you write any new tests?\r\n  - What operating systems did you test with? (please use specific versions: http://whatsmyos.com/)\r\n  - What other devices did you test with? (other Desktop devices, Android, Android Simulator, iOS, iOS Simulator)\r\n-->\r\n","created_at":"2018-02-09T20:40:58Z","updated_at":"2018-02-09T22:06:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"613d68889475d09b7e0c3c4dd5449d74850b2608","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":832699515,"url":"https://api.github.com/repos/signalapp/Signal-Desktop/labels/WIP","name":"WIP","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2040/commits","review_comments_url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2040/comments","review_comment_url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/2040/comments","statuses_url":"https://api.github.com/repos/signalapp/Signal-Desktop/statuses/d8baa707d6cec3c864c6a88500ba06cb4d133d0a","head":{"label":"signalapp:998-auto-orient-images","ref":"998-auto-orient-images","sha":"d8baa707d6cec3c864c6a88500ba06cb4d133d0a","user":{"login":"signalapp","id":702459,"avatar_url":"https://avatars2.githubusercontent.com/u/702459?v=4","gravatar_id":"","url":"https://api.github.com/users/signalapp","html_url":"https://github.com/signalapp","followers_url":"https://api.github.com/users/signalapp/followers","following_url":"https://api.github.com/users/signalapp/following{/other_user}","gists_url":"https://api.github.com/users/signalapp/gists{/gist_id}","starred_url":"https://api.github.com/users/signalapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalapp/subscriptions","organizations_url":"https://api.github.com/users/signalapp/orgs","repos_url":"https://api.github.com/users/signalapp/repos","events_url":"https://api.github.com/users/signalapp/events{/privacy}","received_events_url":"https://api.github.com/users/signalapp/received_events","type":"Organization","site_admin":false},"repo":{"id":17148588,"name":"Signal-Desktop","full_name":"signalapp/Signal-Desktop","owner":{"login":"signalapp","id":702459,"avatar_url":"https://avatars2.githubusercontent.com/u/702459?v=4","gravatar_id":"","url":"https://api.github.com/users/signalapp","html_url":"https://github.com/signalapp","followers_url":"https://api.github.com/users/signalapp/followers","following_url":"https://api.github.com/users/signalapp/following{/other_user}","gists_url":"https://api.github.com/users/signalapp/gists{/gist_id}","starred_url":"https://api.github.com/users/signalapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalapp/subscriptions","organizations_url":"https://api.github.com/users/signalapp/orgs","repos_url":"https://api.github.com/users/signalapp/repos","events_url":"https://api.github.com/users/signalapp/events{/privacy}","received_events_url":"https://api.github.com/users/signalapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/signalapp/Signal-Desktop","description":"Signal Private Messenger for Windows, Mac, and Linux","fork":false,"url":"https://api.github.com/repos/signalapp/Signal-Desktop","forks_url":"https://api.github.com/repos/signalapp/Signal-Desktop/forks","keys_url":"https://api.github.com/repos/signalapp/Signal-Desktop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/signalapp/Signal-Desktop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/signalapp/Signal-Desktop/teams","hooks_url":"https://api.github.com/repos/signalapp/Signal-Desktop/hooks","issue_events_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/events{/number}","events_url":"https://api.github.com/repos/signalapp/Signal-Desktop/events","assignees_url":"https://api.github.com/repos/signalapp/Signal-Desktop/assignees{/user}","branches_url":"https://api.github.com/repos/signalapp/Signal-Desktop/branches{/branch}","tags_url":"https://api.github.com/repos/signalapp/Signal-Desktop/tags","blobs_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/refs{/sha}","trees_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/signalapp/Signal-Desktop/statuses/{sha}","languages_url":"https://api.github.com/repos/signalapp/Signal-Desktop/languages","stargazers_url":"https://api.github.com/repos/signalapp/Signal-Desktop/stargazers","contributors_url":"https://api.github.com/repos/signalapp/Signal-Desktop/contributors","subscribers_url":"https://api.github.com/repos/signalapp/Signal-Desktop/subscribers","subscription_url":"https://api.github.com/repos/signalapp/Signal-Desktop/subscription","commits_url":"https://api.github.com/repos/signalapp/Signal-Desktop/commits{/sha}","git_commits_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/commits{/sha}","comments_url":"https://api.github.com/repos/signalapp/Signal-Desktop/comments{/number}","issue_comment_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/comments{/number}","contents_url":"https://api.github.com/repos/signalapp/Signal-Desktop/contents/{+path}","compare_url":"https://api.github.com/repos/signalapp/Signal-Desktop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/signalapp/Signal-Desktop/merges","archive_url":"https://api.github.com/repos/signalapp/Signal-Desktop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/signalapp/Signal-Desktop/downloads","issues_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues{/number}","pulls_url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls{/number}","milestones_url":"https://api.github.com/repos/signalapp/Signal-Desktop/milestones{/number}","notifications_url":"https://api.github.com/repos/signalapp/Signal-Desktop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/signalapp/Signal-Desktop/labels{/name}","releases_url":"https://api.github.com/repos/signalapp/Signal-Desktop/releases{/id}","deployments_url":"https://api.github.com/repos/signalapp/Signal-Desktop/deployments","created_at":"2014-02-24T19:53:36Z","updated_at":"2018-02-08T23:56:39Z","pushed_at":"2018-02-09T22:02:55Z","git_url":"git://github.com/signalapp/Signal-Desktop.git","ssh_url":"git@github.com:signalapp/Signal-Desktop.git","clone_url":"https://github.com/signalapp/Signal-Desktop.git","svn_url":"https://github.com/signalapp/Signal-Desktop","homepage":"https://signal.org/download","size":53866,"stargazers_count":3030,"watchers_count":3030,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":540,"mirror_url":null,"archived":false,"open_issues_count":322,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":540,"open_issues":322,"watchers":3030,"default_branch":"development"}},"base":{"label":"signalapp:development","ref":"development","sha":"4033a9f8137e62ed286170ed5d4941982b1d3a64","user":{"login":"signalapp","id":702459,"avatar_url":"https://avatars2.githubusercontent.com/u/702459?v=4","gravatar_id":"","url":"https://api.github.com/users/signalapp","html_url":"https://github.com/signalapp","followers_url":"https://api.github.com/users/signalapp/followers","following_url":"https://api.github.com/users/signalapp/following{/other_user}","gists_url":"https://api.github.com/users/signalapp/gists{/gist_id}","starred_url":"https://api.github.com/users/signalapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalapp/subscriptions","organizations_url":"https://api.github.com/users/signalapp/orgs","repos_url":"https://api.github.com/users/signalapp/repos","events_url":"https://api.github.com/users/signalapp/events{/privacy}","received_events_url":"https://api.github.com/users/signalapp/received_events","type":"Organization","site_admin":false},"repo":{"id":17148588,"name":"Signal-Desktop","full_name":"signalapp/Signal-Desktop","owner":{"login":"signalapp","id":702459,"avatar_url":"https://avatars2.githubusercontent.com/u/702459?v=4","gravatar_id":"","url":"https://api.github.com/users/signalapp","html_url":"https://github.com/signalapp","followers_url":"https://api.github.com/users/signalapp/followers","following_url":"https://api.github.com/users/signalapp/following{/other_user}","gists_url":"https://api.github.com/users/signalapp/gists{/gist_id}","starred_url":"https://api.github.com/users/signalapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalapp/subscriptions","organizations_url":"https://api.github.com/users/signalapp/orgs","repos_url":"https://api.github.com/users/signalapp/repos","events_url":"https://api.github.com/users/signalapp/events{/privacy}","received_events_url":"https://api.github.com/users/signalapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/signalapp/Signal-Desktop","description":"Signal Private Messenger for Windows, Mac, and Linux","fork":false,"url":"https://api.github.com/repos/signalapp/Signal-Desktop","forks_url":"https://api.github.com/repos/signalapp/Signal-Desktop/forks","keys_url":"https://api.github.com/repos/signalapp/Signal-Desktop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/signalapp/Signal-Desktop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/signalapp/Signal-Desktop/teams","hooks_url":"https://api.github.com/repos/signalapp/Signal-Desktop/hooks","issue_events_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/events{/number}","events_url":"https://api.github.com/repos/signalapp/Signal-Desktop/events","assignees_url":"https://api.github.com/repos/signalapp/Signal-Desktop/assignees{/user}","branches_url":"https://api.github.com/repos/signalapp/Signal-Desktop/branches{/branch}","tags_url":"https://api.github.com/repos/signalapp/Signal-Desktop/tags","blobs_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/refs{/sha}","trees_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/signalapp/Signal-Desktop/statuses/{sha}","languages_url":"https://api.github.com/repos/signalapp/Signal-Desktop/languages","stargazers_url":"https://api.github.com/repos/signalapp/Signal-Desktop/stargazers","contributors_url":"https://api.github.com/repos/signalapp/Signal-Desktop/contributors","subscribers_url":"https://api.github.com/repos/signalapp/Signal-Desktop/subscribers","subscription_url":"https://api.github.com/repos/signalapp/Signal-Desktop/subscription","commits_url":"https://api.github.com/repos/signalapp/Signal-Desktop/commits{/sha}","git_commits_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/commits{/sha}","comments_url":"https://api.github.com/repos/signalapp/Signal-Desktop/comments{/number}","issue_comment_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/comments{/number}","contents_url":"https://api.github.com/repos/signalapp/Signal-Desktop/contents/{+path}","compare_url":"https://api.github.com/repos/signalapp/Signal-Desktop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/signalapp/Signal-Desktop/merges","archive_url":"https://api.github.com/repos/signalapp/Signal-Desktop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/signalapp/Signal-Desktop/downloads","issues_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues{/number}","pulls_url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls{/number}","milestones_url":"https://api.github.com/repos/signalapp/Signal-Desktop/milestones{/number}","notifications_url":"https://api.github.com/repos/signalapp/Signal-Desktop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/signalapp/Signal-Desktop/labels{/name}","releases_url":"https://api.github.com/repos/signalapp/Signal-Desktop/releases{/id}","deployments_url":"https://api.github.com/repos/signalapp/Signal-Desktop/deployments","created_at":"2014-02-24T19:53:36Z","updated_at":"2018-02-08T23:56:39Z","pushed_at":"2018-02-09T22:02:55Z","git_url":"git://github.com/signalapp/Signal-Desktop.git","ssh_url":"git@github.com:signalapp/Signal-Desktop.git","clone_url":"https://github.com/signalapp/Signal-Desktop.git","svn_url":"https://github.com/signalapp/Signal-Desktop","homepage":"https://signal.org/download","size":53866,"stargazers_count":3030,"watchers_count":3030,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":540,"mirror_url":null,"archived":false,"open_issues_count":322,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":540,"open_issues":322,"watchers":3030,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2040"},"html":{"href":"https://github.com/signalapp/Signal-Desktop/pull/2040"},"issue":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/2040"},"comments":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/2040/comments"},"review_comments":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2040/comments"},"review_comment":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2040/commits"},"statuses":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/statuses/d8baa707d6cec3c864c6a88500ba06cb4d133d0a"}},"author_association":"NONE"}}
{"actor":{"display_login":"gasi"}}