Allow floating point density input (#1362)

Metadata output will still remain integer
This commit is contained in:
Axel Eirola
2018-09-01 10:58:30 +03:00
committed by Lovell Fuller
parent bf3254cb16
commit 7d48a5ccf4
9 changed files with 28 additions and 18 deletions

View File

@@ -36,7 +36,7 @@ function _createInputDescriptor (input, inputOptions, containerOptions) {
}
// Density
if (is.defined(inputOptions.density)) {
if (is.integer(inputOptions.density) && is.inRange(inputOptions.density, 1, 2400)) {
if (is.inRange(inputOptions.density, 1, 2400)) {
inputDescriptor.density = inputOptions.density;
} else {
throw new Error('Invalid density (1 to 2400) ' + inputOptions.density);