{"action":"opened","issue":{"url":"https://api.github.com/repos/devongovett/pdfkit/issues/379","labels_url":"https://api.github.com/repos/devongovett/pdfkit/issues/379/labels{/name}","comments_url":"https://api.github.com/repos/devongovett/pdfkit/issues/379/comments","events_url":"https://api.github.com/repos/devongovett/pdfkit/issues/379/events","html_url":"https://github.com/devongovett/pdfkit/issues/379","id":62641526,"number":379,"title":"Can't add image downloaded from web using request and pipe","user":{"login":"liubin","id":1212008,"avatar_url":"https://avatars.githubusercontent.com/u/1212008?v=3","gravatar_id":"","url":"https://api.github.com/users/liubin","html_url":"https://github.com/liubin","followers_url":"https://api.github.com/users/liubin/followers","following_url":"https://api.github.com/users/liubin/following{/other_user}","gists_url":"https://api.github.com/users/liubin/gists{/gist_id}","starred_url":"https://api.github.com/users/liubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liubin/subscriptions","organizations_url":"https://api.github.com/users/liubin/orgs","repos_url":"https://api.github.com/users/liubin/repos","events_url":"https://api.github.com/users/liubin/events{/privacy}","received_events_url":"https://api.github.com/users/liubin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-18T09:46:51Z","updated_at":"2015-03-18T09:46:51Z","closed_at":null,"body":"Hi \r\n\r\nI want to download a .jpg file from Web and add it to pdf, bug got `Error: stream.push() after EOF` error.\r\n\r\nHere is the code:\r\n\r\n```\r\n  var out = fs.createWriteStream(filepath);\r\n  request('some-url.jpg').pipe(out);\r\n  out.on('finish', function(){\r\n    var stats = fs.statSync(filepath);\r\n    console.log(stats);\r\n    doc.addPage().image(filepath, 33, 34, {fit: [100, 100]});\r\n  });\r\n```\r\n\r\nHere is the error:\r\n```\r\n{ dev: 206529591,\r\n  mode: 33206,\r\n  nlink: 1,\r\n  uid: 0,\r\n  gid: 0,\r\n  rdev: 0,\r\n  blksize: undefined,\r\n  ino: 3377699720980692,\r\n  size: 132953,\r\n  blocks: undefined,\r\n  atime: Wed Mar 18 2015 16:28:03 GMT+0800 (中国标准时间),\r\n  mtime: Wed Mar 18 2015 17:14:18 GMT+0800 (中国标准时间),\r\n  ctime: Wed Mar 18 2015 17:14:18 GMT+0800 (中国标准时间),\r\n  birthtime: Wed Mar 18 2015 16:28:03 GMT+0800 (中国标准时间) }\r\ndata length: 132953\r\nevents.js:85\r\n      throw er; // Unhandled 'error' event\r\n            ^\r\nError: stream.push() after EOF\r\n    at readableAddChunk (_stream_readable.js:149:15)\r\n    at PDFDocument.Readable.push (_stream_readable.js:126:10)\r\n    at PDFDocument._write (E:\\2yi\\ss4cn\\node_modules\\pdfkit\\js\\document.js:153:12)\r\n    at PDFReference.finalize (E:\\2yi\\ss4cn\\node_modules\\pdfkit\\js\\reference.js:73:21)\r\n    at PDFReference.finalize (E:\\2yi\\ss4cn\\node_modules\\pdfkit\\js\\reference.js:10:61)\r\n    at PDFReference.end (E:\\2yi\\ss4cn\\node_modules\\pdfkit\\js\\reference.js:66:21)\r\n    at JPEG.embed (E:\\2yi\\ss4cn\\node_modules\\pdfkit\\js\\image\\jpeg.js:68:16)\r\n    at PDFDocument.module.exports.image (E:\\2yi\\ss4cn\\node_modules\\pdfkit\\js\\mixins\\images.js:28:15)\r\n    at WriteStream.<anonymous> (E:\\2yi\\ss4cn\\index.js:111:19)\r\n    at WriteStream.emit (events.js:129:20)\r\n```\r\n\r\nFrom the `stats`, I think the file is well downloaded.\r\n\r\nNode.js v0.12.0 on Wdinwos 7, and the pdfkit 0.7.0.\r\n\r\nThanks\r\n"}}