mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 15:25:07 +01:00
Docs: improve descripion of create/raw props
This commit is contained in:
@@ -108,13 +108,13 @@ const debuglog = util.debuglog('sharp');
|
||||
* @param {number} [options.level=0] - level to extract from a multi-level input (OpenSlide), zero based.
|
||||
* @param {boolean} [options.animated=false] - Set to `true` to read all frames/pages of an animated image (equivalent of setting `pages` to `-1`).
|
||||
* @param {Object} [options.raw] - describes raw pixel input image data. See `raw()` for pixel ordering.
|
||||
* @param {number} [options.raw.width]
|
||||
* @param {number} [options.raw.height]
|
||||
* @param {number} [options.raw.channels] - 1-4
|
||||
* @param {number} [options.raw.width] - integral number of pixels wide.
|
||||
* @param {number} [options.raw.height] - integral number of pixels high.
|
||||
* @param {number} [options.raw.channels] - integral number of channels, between 1 and 4.
|
||||
* @param {Object} [options.create] - describes a new image to be created.
|
||||
* @param {number} [options.create.width]
|
||||
* @param {number} [options.create.height]
|
||||
* @param {number} [options.create.channels] - 3-4
|
||||
* @param {number} [options.create.width] - integral number of pixels wide.
|
||||
* @param {number} [options.create.height] - integral number of pixels high.
|
||||
* @param {number} [options.create.channels] - integral number of channels, either 3 (RGB) or 4 (RGBA).
|
||||
* @param {string|Object} [options.create.background] - parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha.
|
||||
* @returns {Sharp}
|
||||
* @throws {Error} Invalid parameters
|
||||
|
||||
@@ -149,7 +149,7 @@ function _createInputDescriptor (input, inputOptions, containerOptions) {
|
||||
];
|
||||
delete inputDescriptor.buffer;
|
||||
} else {
|
||||
throw new Error('Expected width, height, channels and background to create a new input image');
|
||||
throw new Error('Expected valid width, height, channels and background to create a new input image');
|
||||
}
|
||||
}
|
||||
} else if (is.defined(inputOptions)) {
|
||||
|
||||
Reference in New Issue
Block a user