Skip to content

Commit

Permalink
Ensure close event occurs after end event #3313
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Sep 20, 2022
1 parent 32aa3b4 commit 70e6bb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docs/changelog.md
Expand Up @@ -6,6 +6,9 @@ Requires libvips v8.13.1

### v0.31.1 - TBD

* Ensure `close` event occurs after `end` event for Stream-based output.
[#3313](https://github.com/lovell/sharp/issues/3313)

* Ensure `limitInputPixels` constructor option uses uint64.
[#3349](https://github.com/lovell/sharp/pull/3349)
[@marcosc90](https://github.com/marcosc90)
Expand Down
4 changes: 2 additions & 2 deletions lib/output.js
Expand Up @@ -1205,7 +1205,7 @@ function _pipeline (callback) {
this.push(data);
}
this.push(null);
this.emit('close');
this.on('end', () => this.emit('close'));
});
});
if (this.streamInFinished) {
Expand All @@ -1221,7 +1221,7 @@ function _pipeline (callback) {
this.push(data);
}
this.push(null);
this.emit('close');
this.on('end', () => this.emit('close'));
});
}
return this;
Expand Down

0 comments on commit 70e6bb0

Please sign in to comment.