From c9d32e22d3d8b0335240df9c2dae6c9299ab2e73 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Tue, 5 Jul 2016 11:17:41 +0100 Subject: [PATCH] Docs, changelog for top/left overlayWith offset #473 --- docs/api.md | 8 ++++++-- docs/changelog.md | 4 ++++ docs/index.md | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/api.md b/docs/api.md index 03d1d3a5..fbdb16dd 100644 --- a/docs/api.md +++ b/docs/api.md @@ -400,8 +400,8 @@ sharp(input) }) .raw() .toBuffer(function(err, data, info) { - // data contains the raw pixel data representing the input image - // convolved with the horizontal Sobel operator + // data contains the raw pixel data representing the convolution + // of the input image with the horizontal Sobel operator }); ``` @@ -457,9 +457,13 @@ Overlay (composite) a image containing an alpha channel over the processed (resi `options`, if present, is an Object with the following optional attributes: * `gravity` is a String or an attribute of the `sharp.gravity` Object e.g. `sharp.gravity.north` at which to place the overlay, defaulting to `center`/`centre`. +* `top` is an integral Number representing the pixel offset from the top edge. +* `left` is an integral Number representing the pixel offset from the left edge. * `tile` is a Boolean, defaulting to `false`. When set to `true` repeats the overlay image across the entire image with the given `gravity`. * `cutout` is a Boolean, defaulting to `false`. When set to `true` applies only the alpha channel of the overlay image to the image to be overlaid, giving the appearance of one image being cut out of another. +If both `top` and `left` are provided, they take precedence over `gravity`. + ```javascript sharp('input.png') .rotate(180) diff --git a/docs/changelog.md b/docs/changelog.md index 202c7fc2..a34fd4f4 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -30,6 +30,10 @@ Requires libvips v8.3.1 [#456](https://github.com/lovell/sharp/pull/456) [@kapouer](https://github.com/kapouer) +* Add top/left offset support to overlayWith operation. + [#473](https://github.com/lovell/sharp/pull/473) + [@rnanwani](https://github.com/rnanwani) + * Add convolve operation for kernel-based convolution. [#479](https://github.com/lovell/sharp/pull/479) [@mhirsch](https://github.com/mhirsch) diff --git a/docs/index.md b/docs/index.md index 9c753ab8..17d17cf1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -96,6 +96,7 @@ the help and code contributions of the following people: * [F. Orlando Galashan](https://github.com/frulo) * [Kleis Auke Wolthuizen](https://github.com/kleisauke) * [Matt Hirsch](https://github.com/mhirsch) +* [Rahul Nanwani](https://github.com/rnanwani) Thank you!