{"action":"created","issue":{"url":"https://api.github.com/repos/lovell/sharp/issues/1003","repository_url":"https://api.github.com/repos/lovell/sharp","labels_url":"https://api.github.com/repos/lovell/sharp/issues/1003/labels{/name}","comments_url":"https://api.github.com/repos/lovell/sharp/issues/1003/comments","events_url":"https://api.github.com/repos/lovell/sharp/issues/1003/events","html_url":"https://github.com/lovell/sharp/issues/1003","id":267956343,"number":1003,"title":"Error: shrinkv: image has shrunk to nothing","user":{"login":"rexxars","id":48200,"avatar_url":"https://avatars2.githubusercontent.com/u/48200?v=4","gravatar_id":"","url":"https://api.github.com/users/rexxars","html_url":"https://github.com/rexxars","followers_url":"https://api.github.com/users/rexxars/followers","following_url":"https://api.github.com/users/rexxars/following{/other_user}","gists_url":"https://api.github.com/users/rexxars/gists{/gist_id}","starred_url":"https://api.github.com/users/rexxars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rexxars/subscriptions","organizations_url":"https://api.github.com/users/rexxars/orgs","repos_url":"https://api.github.com/users/rexxars/repos","events_url":"https://api.github.com/users/rexxars/events{/privacy}","received_events_url":"https://api.github.com/users/rexxars/received_events","type":"User","site_admin":false},"labels":[{"id":52750124,"url":"https://api.github.com/repos/lovell/sharp/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":327116023,"url":"https://api.github.com/repos/lovell/sharp/labels/feedback-welcome","name":"feedback-welcome","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-24T09:17:33Z","updated_at":"2017-11-15T06:08:56Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nIf you use an image that is 2000x4 and resize to 100px in width using `img.max().resize(100)`, you will get this error: `Error: shrinkv: image has shrunk to nothing`.\r\n\r\nI'm not sure if you consider this to be something that should be handled by the user before passing the size on to sharp, but I would have loved if it simply capped it at 1px in height to avoid the error.\r\n\r\nThoughts?\r\n\r\n```js\r\nconst sharp = require('sharp')\r\n\r\nsharp('2000x4.png')\r\n  .max()\r\n  .resize(100)\r\n  .toBuffer()\r\n  .then(res => {\r\n    console.log(res)\r\n  }).catch(err => {\r\n    console.error(err.stack)\r\n  })\r\n```"},"comment":{"url":"https://api.github.com/repos/lovell/sharp/issues/comments/344495481","html_url":"https://github.com/lovell/sharp/issues/1003#issuecomment-344495481","issue_url":"https://api.github.com/repos/lovell/sharp/issues/1003","id":344495481,"user":{"login":"rnanwani","id":4739557,"avatar_url":"https://avatars2.githubusercontent.com/u/4739557?v=4","gravatar_id":"","url":"https://api.github.com/users/rnanwani","html_url":"https://github.com/rnanwani","followers_url":"https://api.github.com/users/rnanwani/followers","following_url":"https://api.github.com/users/rnanwani/following{/other_user}","gists_url":"https://api.github.com/users/rnanwani/gists{/gist_id}","starred_url":"https://api.github.com/users/rnanwani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnanwani/subscriptions","organizations_url":"https://api.github.com/users/rnanwani/orgs","repos_url":"https://api.github.com/users/rnanwani/repos","events_url":"https://api.github.com/users/rnanwani/events{/privacy}","received_events_url":"https://api.github.com/users/rnanwani/received_events","type":"User","site_admin":false},"created_at":"2017-11-15T06:08:56Z","updated_at":"2017-11-15T06:08:56Z","author_association":"CONTRIBUTOR","body":"I would vote for a lower limit set at 1px for either dimension to accommodate for older screens. And beyond that limit to ignore the aspect ratio for the final resize."}}
{"actor":{"display_login":"rnanwani"}}