Docs: clarify response object description for trim (#2400)

This commit is contained in:
Adam Coster 2020-10-06 11:08:32 -05:00 committed by GitHub
parent 3ec281d104
commit 260ff6c94f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -209,7 +209,8 @@ Returns **Sharp**
Trim "boring" pixels from all edges that contain values similar to the top-left pixel. Trim "boring" pixels from all edges that contain values similar to the top-left pixel.
Images consisting entirely of a single colour will calculate "boring" using the alpha channel, if any. Images consisting entirely of a single colour will calculate "boring" using the alpha channel, if any.
The `info` response Object will contain `trimOffsetLeft` and `trimOffsetTop` properties. The `info` response Object, obtained from callback of `.toFile()` or `.toBuffer()`,
will contain `trimOffsetLeft` and `trimOffsetTop` properties.
### Parameters ### Parameters

View File

@ -386,7 +386,8 @@ function extract (options) {
* Trim "boring" pixels from all edges that contain values similar to the top-left pixel. * Trim "boring" pixels from all edges that contain values similar to the top-left pixel.
* Images consisting entirely of a single colour will calculate "boring" using the alpha channel, if any. * Images consisting entirely of a single colour will calculate "boring" using the alpha channel, if any.
* *
* The `info` response Object will contain `trimOffsetLeft` and `trimOffsetTop` properties. * The `info` response Object, obtained from callback of `.toFile()` or `.toBuffer()`,
* will contain `trimOffsetLeft` and `trimOffsetTop` properties.
* *
* @param {number} [threshold=10] the allowed difference from the top-left pixel, a number greater than zero. * @param {number} [threshold=10] the allowed difference from the top-left pixel, a number greater than zero.
* @returns {Sharp} * @returns {Sharp}