{"action":"created","issue":{"url":"https://api.github.com/repos/thibaud-rohmer/PhotoShow/issues/286","repository_url":"https://api.github.com/repos/thibaud-rohmer/PhotoShow","labels_url":"https://api.github.com/repos/thibaud-rohmer/PhotoShow/issues/286/labels{/name}","comments_url":"https://api.github.com/repos/thibaud-rohmer/PhotoShow/issues/286/comments","events_url":"https://api.github.com/repos/thibaud-rohmer/PhotoShow/issues/286/events","html_url":"https://github.com/thibaud-rohmer/PhotoShow/issues/286","id":91774296,"number":286,"title":"does not apply exif rotation information","user":{"login":"Caliandroid","id":4968300,"avatar_url":"https://avatars.githubusercontent.com/u/4968300?v=3","gravatar_id":"","url":"https://api.github.com/users/Caliandroid","html_url":"https://github.com/Caliandroid","followers_url":"https://api.github.com/users/Caliandroid/followers","following_url":"https://api.github.com/users/Caliandroid/following{/other_user}","gists_url":"https://api.github.com/users/Caliandroid/gists{/gist_id}","starred_url":"https://api.github.com/users/Caliandroid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Caliandroid/subscriptions","organizations_url":"https://api.github.com/users/Caliandroid/orgs","repos_url":"https://api.github.com/users/Caliandroid/repos","events_url":"https://api.github.com/users/Caliandroid/events{/privacy}","received_events_url":"https://api.github.com/users/Caliandroid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-29T11:06:26Z","updated_at":"2016-06-15T20:19:29Z","closed_at":null,"body":"I've remarked that the uploaded pictures aren't displayed according to their exif roation information.\r\nThis would be a great feature.\r\n\r\nAs alternative a manuel rotation feature would be also handy."},"comment":{"url":"https://api.github.com/repos/thibaud-rohmer/PhotoShow/issues/comments/226307504","html_url":"https://github.com/thibaud-rohmer/PhotoShow/issues/286#issuecomment-226307504","issue_url":"https://api.github.com/repos/thibaud-rohmer/PhotoShow/issues/286","id":226307504,"user":{"login":"Swiiney","id":19938645,"avatar_url":"https://avatars.githubusercontent.com/u/19938645?v=3","gravatar_id":"","url":"https://api.github.com/users/Swiiney","html_url":"https://github.com/Swiiney","followers_url":"https://api.github.com/users/Swiiney/followers","following_url":"https://api.github.com/users/Swiiney/following{/other_user}","gists_url":"https://api.github.com/users/Swiiney/gists{/gist_id}","starred_url":"https://api.github.com/users/Swiiney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Swiiney/subscriptions","organizations_url":"https://api.github.com/users/Swiiney/orgs","repos_url":"https://api.github.com/users/Swiiney/repos","events_url":"https://api.github.com/users/Swiiney/events{/privacy}","received_events_url":"https://api.github.com/users/Swiiney/received_events","type":"User","site_admin":false},"created_at":"2016-06-15T20:19:29Z","updated_at":"2016-06-15T20:19:29Z","body":"Hi,\r\n   I had a look at your code and with few modification I got the correct orientation for the pictures.\r\n   I only changed come lines in src/classes/provider.php.\r\n\r\nLine 89 :\r\n```\r\nprivate static function autorotate_jpeg ($filename)\r\n\t{\r\n\t\t$raw_image = imagecreatefromjpeg($filename);\r\n\t\t$degrees = Provider::get_orientation_degrees ($filename);\r\n\t\tif($degrees < 0){\t\t\t//SBO\r\n\t\t\t$degrees=360+$degrees; \t//SBO\r\n\t\t}\t\t\t\t\t\t\t//SBO\r\n\t\tif($degrees > 0){\r\n\t\t\t$rotated_image = imagerotate($raw_image, $degrees, 0);\r\n\t\t\tif($rotated_image == NULL){\r\n\t\t\t\treturn $raw_image;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$rotated_image = $raw_image;\r\n\t\t}\r\n\r\n\t\treturn $rotated_image;\r\n\t}\r\n```\r\n\r\n\r\nLine 247 :\r\n```\r\n            if (File::Type($file) == 'Image' && Provider::get_orientation_degrees($file) != 0) {\r\n                $thumb->SourceImageToGD();\r\n                $thumb->ra = 180 + Provider::get_orientation_degrees($file); //SBO\r\n                $thumb->Rotate();\r\n            }\r\n```\r\n\r\nLine 297 :\r\n```\r\n            if (File::Type($file) == 'Image' && Provider::get_orientation_degrees($file) != 0) {\r\n                $thumb->SourceImageToGD();\r\n                $thumb->ra = 180+Provider::get_orientation_degrees($file); //SBO\r\n                $thumb->Rotate();\r\n            }\r\n```\r\n\r\nLine 383 : reactivated your commented lines\r\n```\r\n            if(File::Type($path)==\"Image\"){\r\n                header('Content-type: image/jpeg');\r\n                try {\r\n                    imagejpeg(Provider::autorotate_jpeg ($path));\t\r\n                }catch(Exception $e){\r\n                    error_log('ERROR/Provider.php: cannot rotate '.$path.': '.$e);\r\n                    readfile($path);\r\n                }\r\n            }else{\r\n```\r\n\r\nMaybe I missed something but it seems to be working...\r\n\r\nStephane"}}
{"actor":{"display_login":"Swiiney"}}