Changelog entry and doc refresh for #2397

This commit is contained in:
Lovell Fuller
2020-10-08 10:05:39 +01:00
parent c213e9878d
commit 20ba0f49dd
5 changed files with 15 additions and 5 deletions

View File

@@ -658,7 +658,8 @@ function raw () {
* @param {number} [options.skipBlanks=-1] threshold to skip tile generation, a value 0 - 255 for 8-bit images or 0 - 65535 for 16-bit images
* @param {string} [options.container='fs'] tile container, with value `fs` (filesystem) or `zip` (compressed file).
* @param {string} [options.layout='dz'] filesystem layout, possible values are `dz`, `iiif`, `zoomify` or `google`.
* @param {boolean} [options.centre=false] center image in tile.
* @param {boolean} [options.centre=false] centre image in tile.
* @param {boolean} [options.center=false] alternative spelling of centre.
* @returns {Sharp}
* @throws {Error} Invalid parameters
*/
@@ -728,8 +729,9 @@ function tile (options) {
this.options.tileSkipBlanks = 5;
}
// Center image in tile
if (is.defined(options.centre) || is.defined(options.center)) {
this._setBooleanOption('tileCentre', options.centre || options.center);
const centre = is.bool(options.center) ? options.center : options.centre;
if (is.defined(centre)) {
this._setBooleanOption('tileCentre', centre);
}
}
// Format