mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Docs refresh for cropOffsetLeft/cropOffsetTop
This commit is contained in:
parent
e0f0baf164
commit
7067beda99
@ -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**
|
||||
|
||||
|
@ -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`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user