From 7067beda9919af102bff0f4c0adba9f0400b87d4 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sat, 25 Nov 2017 11:24:53 +0000 Subject: [PATCH] Docs refresh for cropOffsetLeft/cropOffsetTop --- docs/api-output.md | 6 ++++-- lib/output.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/api-output.md b/docs/api-output.md index 922c649b..037f6e6a 100644 --- a/docs/api-output.md +++ b/docs/api-output.md @@ -21,7 +21,7 @@ If an explicit output format is not selected, it will be inferred from the exten with JPEG, PNG, WebP, TIFF, DZI, and libvips' V format supported. Note that raw pixel data is only supported for buffer output. -A Promises/A+ promise is returned when `callback` is not provided. +A `Promise` is returned when `callback` is not provided. **Parameters** @@ -48,7 +48,9 @@ By default, the format will match the input image, except GIF and SVG input whic - `data` is the output image data. - `info` contains the output image `format`, `size` (bytes), `width`, `height`, `channels` and `premultiplied` (indicating if premultiplication was used). - A Promise is returned when `callback` is not provided. + When using a crop strategy also contains `cropOffsetLeft` and `cropOffsetTop`. + +A `Promise` is returned when `callback` is not provided. **Parameters** diff --git a/lib/output.js b/lib/output.js index bd368f54..e24926fc 100644 --- a/lib/output.js +++ b/lib/output.js @@ -10,7 +10,7 @@ const sharp = require('../build/Release/sharp.node'); * with JPEG, PNG, WebP, TIFF, DZI, and libvips' V format supported. * Note that raw pixel data is only supported for buffer output. * - * A Promises/A+ promise is returned when `callback` is not provided. + * A `Promise` is returned when `callback` is not provided. * * @param {String} fileOut - the path to write the image data to. * @param {Function} [callback] - called on completion with two arguments `(err, info)`. @@ -54,7 +54,9 @@ function toFile (fileOut, callback) { * - `data` is the output image data. * - `info` contains the output image `format`, `size` (bytes), `width`, `height`, * `channels` and `premultiplied` (indicating if premultiplication was used). - * A Promise is returned when `callback` is not provided. + * When using a crop strategy also contains `cropOffsetLeft` and `cropOffsetTop`. + * + * A `Promise` is returned when `callback` is not provided. * * @param {Object} [options] * @param {Boolean} [options.resolveWithObject] Resolve the Promise with an Object containing `data` and `info` properties instead of resolving only with `data`.