{"action":"created","issue":{"url":"https://api.github.com/repos/josegonzalez/cakephp-upload/issues/358","repository_url":"https://api.github.com/repos/josegonzalez/cakephp-upload","labels_url":"https://api.github.com/repos/josegonzalez/cakephp-upload/issues/358/labels{/name}","comments_url":"https://api.github.com/repos/josegonzalez/cakephp-upload/issues/358/comments","events_url":"https://api.github.com/repos/josegonzalez/cakephp-upload/issues/358/events","html_url":"https://github.com/josegonzalez/cakephp-upload/pull/358","id":132434750,"number":358,"title":"Always use correct ratio when resizing an image in 'banding' mode using GD","user":{"login":"Sfynx","id":1623909,"avatar_url":"https://avatars.githubusercontent.com/u/1623909?v=3","gravatar_id":"","url":"https://api.github.com/users/Sfynx","html_url":"https://github.com/Sfynx","followers_url":"https://api.github.com/users/Sfynx/followers","following_url":"https://api.github.com/users/Sfynx/following{/other_user}","gists_url":"https://api.github.com/users/Sfynx/gists{/gist_id}","starred_url":"https://api.github.com/users/Sfynx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sfynx/subscriptions","organizations_url":"https://api.github.com/users/Sfynx/orgs","repos_url":"https://api.github.com/users/Sfynx/repos","events_url":"https://api.github.com/users/Sfynx/events{/privacy}","received_events_url":"https://api.github.com/users/Sfynx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-09T14:34:24Z","updated_at":"2016-02-17T08:31:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/josegonzalez/cakephp-upload/pulls/358","html_url":"https://github.com/josegonzalez/cakephp-upload/pull/358","diff_url":"https://github.com/josegonzalez/cakephp-upload/pull/358.diff","patch_url":"https://github.com/josegonzalez/cakephp-upload/pull/358.patch"},"body":"I have noticed that the resize ratio for images is not always calculated correctly when using GD as the thumbnail method and using the 'banding' method (resize to fit, add white space).\r\nDepending on the width and heights of the source and destination images the smallest ratio is not always chosen.\r\n\r\nFor example, when a 110x50 image needs to be resized to 100x10, the ratio gets calculated based on the width difference, not the height difference. This yields ~0.9 instead of 0.2, causing the image to get too big.\r\n\r\nI changed the calculation by taking both the horizontal and vertical ratios and picking the smallest. Let me know what you think.\r\n\r\nIt looks like the ImageMagick method already did this correctly."},"comment":{"url":"https://api.github.com/repos/josegonzalez/cakephp-upload/issues/comments/185093244","html_url":"https://github.com/josegonzalez/cakephp-upload/pull/358#issuecomment-185093244","issue_url":"https://api.github.com/repos/josegonzalez/cakephp-upload/issues/358","id":185093244,"user":{"login":"josegonzalez","id":65675,"avatar_url":"https://avatars.githubusercontent.com/u/65675?v=3","gravatar_id":"","url":"https://api.github.com/users/josegonzalez","html_url":"https://github.com/josegonzalez","followers_url":"https://api.github.com/users/josegonzalez/followers","following_url":"https://api.github.com/users/josegonzalez/following{/other_user}","gists_url":"https://api.github.com/users/josegonzalez/gists{/gist_id}","starred_url":"https://api.github.com/users/josegonzalez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josegonzalez/subscriptions","organizations_url":"https://api.github.com/users/josegonzalez/orgs","repos_url":"https://api.github.com/users/josegonzalez/repos","events_url":"https://api.github.com/users/josegonzalez/events{/privacy}","received_events_url":"https://api.github.com/users/josegonzalez/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T08:31:03Z","updated_at":"2016-02-17T08:31:03Z","body":"Can you fix the phpcs issue in your pr?"}}