From 95eae905f0a0e78d64a393c4cf9fc166d3ff7f0b Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Mon, 24 Feb 2020 16:02:36 +0000 Subject: [PATCH] Ensure limitInputPixels, sequentialRead for composite op #2099 --- docs/changelog.md | 3 +++ lib/composite.js | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index d3692416..c9687e1f 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -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. diff --git a/lib/composite.js b/lib/composite.js index c4345160..42f9f28d 100644 --- a/lib/composite.js +++ b/lib/composite.js @@ -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',