Ensure limitInputPixels, sequentialRead for composite op #2099

This commit is contained in:
Lovell Fuller 2020-02-24 16:02:36 +00:00
parent a90dbcc808
commit 95eae905f0
2 changed files with 7 additions and 2 deletions

View File

@ -17,6 +17,9 @@ Requires libvips v8.9.1
* Ensure correct ordering of rotate-then-trim operations.
[#2087](https://github.com/lovell/sharp/issues/2087)
* Ensure composite accepts `limitInputPixels` and `sequentialRead` input options.
[#2099](https://github.com/lovell/sharp/issues/2099)
## v0.24 - "*wit*"
Requires libvips v8.9.0.

View File

@ -100,8 +100,10 @@ function composite (images) {
if (!is.object(image)) {
throw is.invalidParameterError('image to composite', 'object', image);
}
const { raw, density } = image;
const inputOptions = (raw || density) ? { raw, density } : undefined;
const { raw, density, limitInputPixels, sequentialRead } = image;
const inputOptions = [raw, density, limitInputPixels, sequentialRead].some(is.defined)
? { raw, density, limitInputPixels, sequentialRead }
: undefined;
const composite = {
input: this._createInputDescriptor(image.input, inputOptions, { allowStream: false }),
blend: 'over',