Skip to content

Commit

Permalink
Docs refresh for cropOffsetLeft/cropOffsetTop
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Nov 25, 2017
1 parent e0f0baf commit 7067bed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions docs/api-output.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand All @@ -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**

Expand Down
6 changes: 4 additions & 2 deletions lib/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)`.
Expand Down Expand Up @@ -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`.
Expand Down

0 comments on commit 7067bed

Please sign in to comment.