From e4333ff6b0f48fb50452ed03c3dfa8589ca8e970 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Wed, 14 Aug 2019 20:17:31 +0100 Subject: [PATCH] Changelog entry, credit and doc update for #1835 --- docs/changelog.md | 4 ++++ docs/index.md | 1 + lib/composite.js | 1 + package.json | 3 ++- .../expected.absent.composite.premultiplied.png | Bin .../expected.false.composite.premultiplied.png | Bin .../expected.true.composite.premultiplied.png | Bin .../input.above.composite.premultiplied.png | Bin .../input.below.composite.premultiplied.png | Bin test/unit/composite.js | 0 10 files changed, 8 insertions(+), 1 deletion(-) mode change 100755 => 100644 test/fixtures/expected/expected.absent.composite.premultiplied.png mode change 100755 => 100644 test/fixtures/expected/expected.false.composite.premultiplied.png mode change 100755 => 100644 test/fixtures/expected/expected.true.composite.premultiplied.png mode change 100755 => 100644 test/fixtures/input.above.composite.premultiplied.png mode change 100755 => 100644 test/fixtures/input.below.composite.premultiplied.png mode change 100755 => 100644 test/unit/composite.js diff --git a/docs/changelog.md b/docs/changelog.md index 25fb1df1..09d9306c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -13,6 +13,10 @@ Requires libvips v8.8.1. [#1834](https://github.com/lovell/sharp/pull/1834) [@jaubourg](https://github.com/jaubourg) +* Add `premultiplied` option to `composite` operation. + [#1835](https://github.com/lovell/sharp/pull/1835) + [@Andargor](https://github.com/Andargor) + * Ensure image is at least 3x3 pixels before attempting trim operation. #### v0.23.0 - 29th July 2019 diff --git a/docs/index.md b/docs/index.md index f6e6c5f3..a9627605 100644 --- a/docs/index.md +++ b/docs/index.md @@ -126,6 +126,7 @@ the help and code contributions of the following people: * [Michael B. Klein](https://github.com/mbklein) * [Jakub Michálek](https://github.com/Goues) * [Ilya Ovdin](https://github.com/iovdin) +* [Andargor](https://github.com/Andargor) Thank you! diff --git a/lib/composite.js b/lib/composite.js index 24f61e4a..cdcf57ee 100644 --- a/lib/composite.js +++ b/lib/composite.js @@ -81,6 +81,7 @@ const blend = { * @param {Number} [images[].top] - the pixel offset from the top edge. * @param {Number} [images[].left] - the pixel offset from the left edge. * @param {Boolean} [images[].tile=false] - set to true to repeat the overlay image across the entire image with the given `gravity`. + * @param {Boolean} [images[].premultiplied=false] - set to true to avoid premultipling the image below. Equivalent to the `--premultiplied` vips option. * @param {Number} [images[].density=72] - number representing the DPI for vector overlay image. * @param {Object} [images[].raw] - describes overlay when using raw pixel data. * @param {Number} [images[].raw.width] diff --git a/package.json b/package.json index 000fc938..d0d6a544 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,8 @@ "Keith Belovay ", "Michael B. Klein ", "Jordan Prudhomme ", - "Ilya Ovdin " + "Ilya Ovdin ", + "Andargor " ], "scripts": { "install": "(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)", diff --git a/test/fixtures/expected/expected.absent.composite.premultiplied.png b/test/fixtures/expected/expected.absent.composite.premultiplied.png old mode 100755 new mode 100644 diff --git a/test/fixtures/expected/expected.false.composite.premultiplied.png b/test/fixtures/expected/expected.false.composite.premultiplied.png old mode 100755 new mode 100644 diff --git a/test/fixtures/expected/expected.true.composite.premultiplied.png b/test/fixtures/expected/expected.true.composite.premultiplied.png old mode 100755 new mode 100644 diff --git a/test/fixtures/input.above.composite.premultiplied.png b/test/fixtures/input.above.composite.premultiplied.png old mode 100755 new mode 100644 diff --git a/test/fixtures/input.below.composite.premultiplied.png b/test/fixtures/input.below.composite.premultiplied.png old mode 100755 new mode 100644 diff --git a/test/unit/composite.js b/test/unit/composite.js old mode 100755 new mode 100644