From 260ff6c94f17838b84f392dea2f751b50dd76810 Mon Sep 17 00:00:00 2001 From: Adam Coster Date: Tue, 6 Oct 2020 11:08:32 -0500 Subject: [PATCH] Docs: clarify response object description for trim (#2400) --- docs/api-resize.md | 3 ++- lib/resize.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/api-resize.md b/docs/api-resize.md index 2a9a4f82..f2dbbaee 100644 --- a/docs/api-resize.md +++ b/docs/api-resize.md @@ -209,7 +209,8 @@ Returns **Sharp** 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. -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 diff --git a/lib/resize.js b/lib/resize.js index eca92389..ac9eef3f 100644 --- a/lib/resize.js +++ b/lib/resize.js @@ -386,7 +386,8 @@ function extract (options) { * 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. * - * 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. * @returns {Sharp}