{"action":"created","issue":{"url":"https://api.github.com/repos/sebsauvage/MinigalNano/issues/98","labels_url":"https://api.github.com/repos/sebsauvage/MinigalNano/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/sebsauvage/MinigalNano/issues/98/comments","events_url":"https://api.github.com/repos/sebsauvage/MinigalNano/issues/98/events","html_url":"https://github.com/sebsauvage/MinigalNano/issues/98","id":83075547,"number":98,"title":"Bug: MediaBox lightbox overlay image distorded/squared due to commit 3fc42c0","user":{"login":"Lucas-C","id":925560,"avatar_url":"https://avatars.githubusercontent.com/u/925560?v=3","gravatar_id":"","url":"https://api.github.com/users/Lucas-C","html_url":"https://github.com/Lucas-C","followers_url":"https://api.github.com/users/Lucas-C/followers","following_url":"https://api.github.com/users/Lucas-C/following{/other_user}","gists_url":"https://api.github.com/users/Lucas-C/gists{/gist_id}","starred_url":"https://api.github.com/users/Lucas-C/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lucas-C/subscriptions","organizations_url":"https://api.github.com/users/Lucas-C/orgs","repos_url":"https://api.github.com/users/Lucas-C/repos","events_url":"https://api.github.com/users/Lucas-C/events{/privacy}","received_events_url":"https://api.github.com/users/Lucas-C/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-31T12:13:40Z","updated_at":"2015-06-10T15:52:47Z","closed_at":null,"body":"This problem appear on photos whose EXIF metadata specify they have been rotated, when clicking on the miniature in the gallery to display the MediaBox.\r\n\r\nLet start from the beginning of my journey:\r\n\r\n- initially, I was making a photo gallery, and found out that some pictures where distorted:\r\nhttps://chezsoi.org/lucas/minigalnano_bug_reproduction/distorted\r\nI found out that, on my Firefox 38, the width & height defined in the inline CSS are **inverted**.\r\nI tried in Chromium 41, and the image proportions are OK but the image is not oriented properly.\r\n\r\n- to fix this, I used ImageMagick to get rid of the EXIF information and resave the photo with the proper orientation, following [this SO answer](http://stackoverflow.com/a/19475281/636849)\r\n```\r\nexiftool my_photo_ko.JPG | grep -E 'Orient|Image Size'\r\n# Orientation : Rotate 270 CW\r\n# Image Size : 1469x1102\r\nconvert my_photo_ko.JPG -auto-orient my_photo_ok.JPG\r\nexiftool my_photo_ok.JPG | grep -E 'Orient|Image Size'\r\n# Orientation : Horizontal (normal)\r\n# Image Size : 1102x1469\r\n```\r\nBut now the MediaBox image was squared: https://chezsoi.org/lucas/minigalnano_bug_reproduction/squared/\r\n\r\n- finally, I simply reverted commit 3fc42c0 by @jniggemann and it all worked fine in both Firefox 38 and Chromium 41 : https://chezsoi.org/lucas/minigalnano_bug_reproduction/fixed/\r\n\r\nHence the bug report: shouldn't this commit be reverted, as it seems to introduce new issues while fixing others ?\r\nAnother solution would be to properly fix this patch code to cope with my original distortion issue.\r\nBut this would probably require detecting the EXIF orientation in such problematic photo:\r\n```javascript\r\nvar img = new Image()\r\nimg.src = \"https://chezsoi.org/lucas/minigalnano_bug_reproduction/distorted/photos/30percent_resized_nonautoriented_P1020697.JPG\"\r\nconsole.log(img.width, img.height) // \"Wrong\", unoriented dimensions: 1469 1102\r\n```"},"comment":{"url":"https://api.github.com/repos/sebsauvage/MinigalNano/issues/comments/110808750","html_url":"https://github.com/sebsauvage/MinigalNano/issues/98#issuecomment-110808750","issue_url":"https://api.github.com/repos/sebsauvage/MinigalNano/issues/98","id":110808750,"user":{"login":"jniggemann","id":1318059,"avatar_url":"https://avatars.githubusercontent.com/u/1318059?v=3","gravatar_id":"","url":"https://api.github.com/users/jniggemann","html_url":"https://github.com/jniggemann","followers_url":"https://api.github.com/users/jniggemann/followers","following_url":"https://api.github.com/users/jniggemann/following{/other_user}","gists_url":"https://api.github.com/users/jniggemann/gists{/gist_id}","starred_url":"https://api.github.com/users/jniggemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jniggemann/subscriptions","organizations_url":"https://api.github.com/users/jniggemann/orgs","repos_url":"https://api.github.com/users/jniggemann/repos","events_url":"https://api.github.com/users/jniggemann/events{/privacy}","received_events_url":"https://api.github.com/users/jniggemann/received_events","type":"User","site_admin":false},"created_at":"2015-06-10T15:52:47Z","updated_at":"2015-06-10T15:52:47Z","body":"@Lucas-C Can you please pull from my repo and\r\n- test \"as is\" (i.e. without autorotation done by firefox)\r\n- apply the patch from the patches directory and test again\r\n\r\nPlease check for 2 things:\r\n1) are all thumbnails properly rotated?\r\n2) are the images distorted\r\n\r\nImages to test with can be found in https://github.com/jniggemann/exif-orientation-examples"}}