mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Allow floating point density input (#1362)
Metadata output will still remain integer
This commit is contained in:
committed by
Lovell Fuller
parent
bf3254cb16
commit
7d48a5ccf4
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user