Add support for page selection with multi-page TIFF input (#1204)

This commit is contained in:
Nathan Graves
2018-04-24 14:57:27 -07:00
committed by Lovell Fuller
parent 8ef1532691
commit b154cd0418
7 changed files with 84 additions and 1 deletions

View File

@@ -57,6 +57,12 @@ function _createInputDescriptor (input, inputOptions, containerOptions) {
throw new Error('Expected width, height and channels for raw pixel input');
}
}
// Page input for multi-page TIFF
if (is.defined(inputOptions.page)) {
if (is.integer(inputOptions.page) && is.inRange(inputOptions.page, 0, 100000)) {
inputDescriptor.page = inputOptions.page;
}
}
// Create new image
if (is.defined(inputOptions.create)) {
if (