mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Avoid (un)premultiplication for overlay image without alpha channel
Add 'premultiplied' boolean attribute to output info, helps test
This commit is contained in:
@@ -15,7 +15,8 @@ const sharp = require('../build/Release/sharp.node');
|
||||
*
|
||||
* @param {String} fileOut - the path to write the image data to.
|
||||
* @param {Function} [callback] - called on completion with two arguments `(err, info)`.
|
||||
* `info` contains the output image `format`, `size` (bytes), `width`, `height` and `channels`.
|
||||
* `info` contains the output image `format`, `size` (bytes), `width`, `height`,
|
||||
* `channels` and `premultiplied` (indicating if premultiplication was used).
|
||||
* @returns {Promise<Object>} - when no callback is provided
|
||||
* @throws {Error} Invalid parameters
|
||||
*/
|
||||
@@ -51,7 +52,8 @@ function toFile (fileOut, callback) {
|
||||
* `callback`, if present, gets three arguments `(err, data, info)` where:
|
||||
* - `err` is an error, if any.
|
||||
* - `data` is the output image data.
|
||||
* - `info` contains the output image `format`, `size` (bytes), `width`, `height` and `channels`.
|
||||
* - `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.
|
||||
*
|
||||
* @param {Object} [options]
|
||||
|
||||
Reference in New Issue
Block a user