Ensure consistent, correct detection of input opts #2118

This commit is contained in:
Lovell Fuller
2020-03-08 14:32:17 +00:00
parent 24285bb0e0
commit 4894c10dd9
3 changed files with 21 additions and 7 deletions

View File

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