Doc refresh for #1438 #1439

This commit is contained in:
Lovell Fuller
2018-11-11 17:40:19 +00:00
parent a48f8fbb61
commit f00928dedb
4 changed files with 47 additions and 42 deletions

View File

@@ -189,9 +189,12 @@ function flatten (options) {
* then increasing the encoding (brighten) post-resize at a factor of `gamma`.
* This can improve the perceived brightness of a resized image in non-linear colour spaces.
* JPEG and WebP input images will not take advantage of the shrink-on-load performance optimisation
* when applying a gamma correction. Supply a second argument to use a different output gamma value, otherwise the first value is used in both cases.
* when applying a gamma correction.
*
* Supply a second argument to use a different output gamma value, otherwise the first value is used in both cases.
*
* @param {Number} [gamma=2.2] value between 1.0 and 3.0.
* @param {Number} [gammaOut] value between 1.0 and 3.0. Defaults to same as gamma.
* @param {Number} [gammaOut] value between 1.0 and 3.0. (optional, defaults to same as `gamma`)
* @returns {Sharp}
* @throws {Error} Invalid parameters
*/
@@ -210,7 +213,7 @@ function gamma (gamma, gammaOut) {
} else if (is.number(gammaOut) && is.inRange(gammaOut, 1, 3)) {
this.options.gammaOut = gammaOut;
} else {
throw new Error('Invalid post gamma correction (1.0 to 3.0) ' + gammaOut);
throw new Error('Invalid output gamma correction (1.0 to 3.0) ' + gammaOut);
}
return this;
}