From bf9bb563676da8074f441004f142e2d0732335d1 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sat, 22 Apr 2023 13:56:33 +0100 Subject: [PATCH] Docs: fix affine interpolator example --- docs/api-operation.md | 4 ++-- lib/index.d.ts | 2 +- lib/operation.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/api-operation.md b/docs/api-operation.md index cc3a1ca15..b97f279d5 100644 --- a/docs/api-operation.md +++ b/docs/api-operation.md @@ -93,7 +93,7 @@ Perform an affine transform on an image. This operation will always occur after You must provide an array of length 4 or a 2x2 affine transformation matrix. By default, new pixels are filled with a black background. You can provide a background color with the `background` option. -A particular interpolator may also be specified. Set the `interpolator` option to an attribute of the `sharp.interpolator` Object e.g. `sharp.interpolator.nohalo`. +A particular interpolator may also be specified. Set the `interpolator` option to an attribute of the `sharp.interpolators` Object e.g. `sharp.interpolators.nohalo`. In the case of a 2x2 matrix, the transform is: - X = `matrix[0, 0]` \* (x + `idx`) + `matrix[0, 1]` \* (y + `idy`) + `odx` @@ -127,7 +127,7 @@ where: const pipeline = sharp() .affine([[1, 0.3], [0.1, 0.7]], { background: 'white', - interpolate: sharp.interpolators.nohalo + interpolator: sharp.interpolators.nohalo }) .toBuffer((err, outputBuffer, info) => { // outputBuffer contains the transformed image diff --git a/lib/index.d.ts b/lib/index.d.ts index bd02f2926..0a815a16c 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -356,7 +356,7 @@ declare namespace sharp { * Perform an affine transform on an image. This operation will always occur after resizing, extraction and rotation, if any. * You must provide an array of length 4 or a 2x2 affine transformation matrix. * By default, new pixels are filled with a black background. You can provide a background color with the `background` option. - * A particular interpolator may also be specified. Set the `interpolator` option to an attribute of the `sharp.interpolator` Object e.g. `sharp.interpolator.nohalo`. + * A particular interpolator may also be specified. Set the `interpolator` option to an attribute of the `sharp.interpolators` Object e.g. `sharp.interpolators.nohalo`. * * In the case of a 2x2 matrix, the transform is: * X = matrix[0, 0] * (x + idx) + matrix[0, 1] * (y + idy) + odx diff --git a/lib/operation.js b/lib/operation.js index 3af2f4d85..7e2b3aef1 100644 --- a/lib/operation.js +++ b/lib/operation.js @@ -114,7 +114,7 @@ function flop (flop) { * * You must provide an array of length 4 or a 2x2 affine transformation matrix. * By default, new pixels are filled with a black background. You can provide a background color with the `background` option. - * A particular interpolator may also be specified. Set the `interpolator` option to an attribute of the `sharp.interpolator` Object e.g. `sharp.interpolator.nohalo`. + * A particular interpolator may also be specified. Set the `interpolator` option to an attribute of the `sharp.interpolators` Object e.g. `sharp.interpolators.nohalo`. * * In the case of a 2x2 matrix, the transform is: * - X = `matrix[0, 0]` \* (x + `idx`) + `matrix[0, 1]` \* (y + `idy`) + `odx` @@ -131,7 +131,7 @@ function flop (flop) { * const pipeline = sharp() * .affine([[1, 0.3], [0.1, 0.7]], { * background: 'white', - * interpolate: sharp.interpolators.nohalo + * interpolator: sharp.interpolators.nohalo * }) * .toBuffer((err, outputBuffer, info) => { * // outputBuffer contains the transformed image