{"action":"created","issue":{"url":"https://api.github.com/repos/oliver-moran/jimp/issues/36","labels_url":"https://api.github.com/repos/oliver-moran/jimp/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/oliver-moran/jimp/issues/36/comments","events_url":"https://api.github.com/repos/oliver-moran/jimp/issues/36/events","html_url":"https://github.com/oliver-moran/jimp/issues/36","id":108513872,"number":36,"title":"Stream support.","user":{"login":"DylanPiercey","id":4985201,"avatar_url":"https://avatars.githubusercontent.com/u/4985201?v=3","gravatar_id":"","url":"https://api.github.com/users/DylanPiercey","html_url":"https://github.com/DylanPiercey","followers_url":"https://api.github.com/users/DylanPiercey/followers","following_url":"https://api.github.com/users/DylanPiercey/following{/other_user}","gists_url":"https://api.github.com/users/DylanPiercey/gists{/gist_id}","starred_url":"https://api.github.com/users/DylanPiercey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DylanPiercey/subscriptions","organizations_url":"https://api.github.com/users/DylanPiercey/orgs","repos_url":"https://api.github.com/users/DylanPiercey/repos","events_url":"https://api.github.com/users/DylanPiercey/events{/privacy}","received_events_url":"https://api.github.com/users/DylanPiercey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-27T05:12:26Z","updated_at":"2015-09-27T22:44:18Z","closed_at":null,"body":"This lib looks pretty handy, although it would be nice if we could pipe the image transformations directly to the browser with streams.\r\n\r\nSomething like this.\r\n```javascript\r\n\r\napp.get(\"/my-dynamic-image\", function (req, res) {\r\n    new Jimp(\"lenna.png\", function (err, image) {\r\n         this.resize(512, 512); // resize\r\n         this.pipe(res); // Send off.\r\n    });\r\n});\r\n```\r\n\r\nHowever I think that the api would be more intuative without forcing a callback into the Jimp constructor, and also making `new` optional.\r\n\r\n```javascript\r\n\r\napp.get(\"/my-dynamic-image\", function (req, res) {\r\n    Jimp(\"lenna.png\")\r\n         .resize(512, 512)\r\n         .pipe(res);\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/oliver-moran/jimp/issues/comments/143599505","html_url":"https://github.com/oliver-moran/jimp/issues/36#issuecomment-143599505","issue_url":"https://api.github.com/repos/oliver-moran/jimp/issues/36","id":143599505,"user":{"login":"oliver-moran","id":414918,"avatar_url":"https://avatars.githubusercontent.com/u/414918?v=3","gravatar_id":"","url":"https://api.github.com/users/oliver-moran","html_url":"https://github.com/oliver-moran","followers_url":"https://api.github.com/users/oliver-moran/followers","following_url":"https://api.github.com/users/oliver-moran/following{/other_user}","gists_url":"https://api.github.com/users/oliver-moran/gists{/gist_id}","starred_url":"https://api.github.com/users/oliver-moran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliver-moran/subscriptions","organizations_url":"https://api.github.com/users/oliver-moran/orgs","repos_url":"https://api.github.com/users/oliver-moran/repos","events_url":"https://api.github.com/users/oliver-moran/events{/privacy}","received_events_url":"https://api.github.com/users/oliver-moran/received_events","type":"User","site_admin":false},"created_at":"2015-09-27T22:44:18Z","updated_at":"2015-09-27T22:44:18Z","body":"Sounds like a good idea.\r\n\r\nI'm not sure what would be involved in a `pipe` method. I expect not an awful lot. I can dig into it and see but it might be a while before I get around to it. If you want to do up a function using the following:\r\n\r\n    this.getBuffer(Jimp.JPEG, function(err, buffer) {\r\n        // buffer is JPEG as a buffer\r\n    });\r\n\r\nEither fork and do a pull request or just post your code here and I'll add it.\r\n\r\n(BTW The constructor has a call back because it needs to read a file. It could do a readFileSync but that would be blocking on a server. I'd prefer if it could be chained easily too.)"}}