{"action":"created","issue":{"url":"https://api.github.com/repos/lovell/sharp/issues/236","labels_url":"https://api.github.com/repos/lovell/sharp/issues/236/labels{/name}","comments_url":"https://api.github.com/repos/lovell/sharp/issues/236/comments","events_url":"https://api.github.com/repos/lovell/sharp/issues/236/events","html_url":"https://github.com/lovell/sharp/issues/236","id":90372517,"number":236,"title":"Provide pre-pipeline function to modify options based on input image metadata","user":{"login":"lovell","id":210965,"avatar_url":"https://avatars.githubusercontent.com/u/210965?v=3","gravatar_id":"","url":"https://api.github.com/users/lovell","html_url":"https://github.com/lovell","followers_url":"https://api.github.com/users/lovell/followers","following_url":"https://api.github.com/users/lovell/following{/other_user}","gists_url":"https://api.github.com/users/lovell/gists{/gist_id}","starred_url":"https://api.github.com/users/lovell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lovell/subscriptions","organizations_url":"https://api.github.com/users/lovell/orgs","repos_url":"https://api.github.com/users/lovell/repos","events_url":"https://api.github.com/users/lovell/events{/privacy}","received_events_url":"https://api.github.com/users/lovell/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lovell/sharp/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/lovell/sharp/milestones/8","html_url":"https://github.com/lovell/sharp/milestones/v1.0.0","labels_url":"https://api.github.com/repos/lovell/sharp/milestones/8/labels","id":959379,"number":8,"title":"v1.0.0","description":"The home of API breaking changes","creator":{"login":"lovell","id":210965,"avatar_url":"https://avatars.githubusercontent.com/u/210965?v=3","gravatar_id":"","url":"https://api.github.com/users/lovell","html_url":"https://github.com/lovell","followers_url":"https://api.github.com/users/lovell/followers","following_url":"https://api.github.com/users/lovell/following{/other_user}","gists_url":"https://api.github.com/users/lovell/gists{/gist_id}","starred_url":"https://api.github.com/users/lovell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lovell/subscriptions","organizations_url":"https://api.github.com/users/lovell/orgs","repos_url":"https://api.github.com/users/lovell/repos","events_url":"https://api.github.com/users/lovell/events{/privacy}","received_events_url":"https://api.github.com/users/lovell/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":0,"state":"open","created_at":"2015-01-31T10:58:04Z","updated_at":"2015-11-22T09:21:00Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-06-23T12:20:25Z","updated_at":"2016-01-21T09:06:12Z","closed_at":null,"body":"This could seriously increase the power of Stream-based image processing.\r\n\r\nHere's an example of how halving an image's dimensions could work:\r\n\r\n```javascript\r\nvar halver = sharp().before(function(metadata) {\r\n  this.resize(metadata.width / 2, metadata.height / 2);\r\n});\r\nreadableStream.pipe(halver).pipe(writableStream);\r\n```\r\n\r\nThe existing `metadata` logic can also be improved to require only the first few hundred bytes of a Stream.\r\n\r\nIn addition, adding a \"playbook\" of example uses for this feature to the docs would be great too. There's a variable/percentage extract/crop under discussion at #205 that this should allow for."},"comment":{"url":"https://api.github.com/repos/lovell/sharp/issues/comments/173506029","html_url":"https://github.com/lovell/sharp/issues/236#issuecomment-173506029","issue_url":"https://api.github.com/repos/lovell/sharp/issues/236","id":173506029,"user":{"login":"lovell","id":210965,"avatar_url":"https://avatars.githubusercontent.com/u/210965?v=3","gravatar_id":"","url":"https://api.github.com/users/lovell","html_url":"https://github.com/lovell","followers_url":"https://api.github.com/users/lovell/followers","following_url":"https://api.github.com/users/lovell/following{/other_user}","gists_url":"https://api.github.com/users/lovell/gists{/gist_id}","starred_url":"https://api.github.com/users/lovell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lovell/subscriptions","organizations_url":"https://api.github.com/users/lovell/orgs","repos_url":"https://api.github.com/users/lovell/repos","events_url":"https://api.github.com/users/lovell/events{/privacy}","received_events_url":"https://api.github.com/users/lovell/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T09:06:12Z","updated_at":"2016-01-21T09:06:12Z","body":"@Lanfei Not yet, sorry, but please do subscribe to this issue for updates."}}