{"action":"closed","issue":{"url":"https://api.github.com/repos/lovell/sharp/issues/671","repository_url":"https://api.github.com/repos/lovell/sharp","labels_url":"https://api.github.com/repos/lovell/sharp/issues/671/labels{/name}","comments_url":"https://api.github.com/repos/lovell/sharp/issues/671/comments","events_url":"https://api.github.com/repos/lovell/sharp/issues/671/events","html_url":"https://github.com/lovell/sharp/issues/671","id":199167738,"number":671,"title":"Streaming compatibility with archiver","user":{"login":"danhaller","id":2386801,"avatar_url":"https://avatars.githubusercontent.com/u/2386801?v=3","gravatar_id":"","url":"https://api.github.com/users/danhaller","html_url":"https://github.com/danhaller","followers_url":"https://api.github.com/users/danhaller/followers","following_url":"https://api.github.com/users/danhaller/following{/other_user}","gists_url":"https://api.github.com/users/danhaller/gists{/gist_id}","starred_url":"https://api.github.com/users/danhaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danhaller/subscriptions","organizations_url":"https://api.github.com/users/danhaller/orgs","repos_url":"https://api.github.com/users/danhaller/repos","events_url":"https://api.github.com/users/danhaller/events{/privacy}","received_events_url":"https://api.github.com/users/danhaller/received_events","type":"User","site_admin":false},"labels":[{"id":52750122,"url":"https://api.github.com/repos/lovell/sharp/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/lovell/sharp/milestones/29","html_url":"https://github.com/lovell/sharp/milestone/29","labels_url":"https://api.github.com/repos/lovell/sharp/milestones/29/labels","id":2252843,"number":29,"title":"v0.17.2","description":"","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":0,"closed_issues":2,"state":"open","created_at":"2017-01-15T15:52:20Z","updated_at":"2017-02-11T10:57:35Z","due_on":null,"closed_at":null},"comments":14,"created_at":"2017-01-06T10:29:33Z","updated_at":"2017-02-11T10:57:35Z","closed_at":"2017-02-11T10:57:35Z","body":"Hi,\r\n\r\nI'm trying to use _sharp_'s streaming capability in tandem with [_archiver_](https://github.com/archiverjs/node-archiver) to resize and zip multiple images and stream out to a consumer.  I can get each library to work on their own, but not together on any more than a single image.\r\n\r\nHere's some example code:\r\n\r\n```js\r\nconst fs = require('fs');\r\nconst archiver = require('archiver');\r\nconst sharp = require('sharp');\r\n//const imagemagick = require('imagemagick-stream');\r\nconst request = require('request');\r\n\r\nfunction resizeAndZip() {\r\n  const imageStreams = [\r\n    request('http://i.stack.imgur.com/tKsDb.png'),\r\n    request('http://i.stack.imgur.com/EdUwb.png'),\r\n    request('http://i.stack.imgur.com/5d55j.png')\r\n  ];\r\n\r\n  const zip = archiver('zip');\r\n\r\n  zip.on('entry', (entry) => console.log(`${entry.name} successfully appended to zip`));\r\n\r\n  imageStreams.map((stream) => {\r\n    const resize = sharp().resize(100, 100);\r\n    // const resize = imagemagick().resize('100x100');\r\n\r\n    return stream.pipe(resize);\r\n  })\r\n  .forEach((resizedImageStream, i) => {\r\n    zip.append(resizedImageStream, { name: `${i}.png` });\r\n  });\r\n\r\n  zip.finalize();\r\n\r\n  return zip;\r\n}\r\n\r\nresizeAndZip().pipe(fs.createWriteStream(__dirname + '/output.zip'));\r\n```\r\n\r\nIn the example you can see that I've also imported imagemagick-stream.  If this library is used as the resizer instead of sharp everything works fine.  I'm not sure whether this is a compatibility problem or if I'm using sharp incorrectly."}}
{"actor":{"display_login":"lovell"}}