From 9f79f80a9364669f74b6bbb57cfca5698d0d3924 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Mon, 16 Jan 2023 12:06:50 +0000 Subject: [PATCH] Docs: fastShrinkOnLoad can round-down when auto-scaling --- docs/api-resize.md | 2 +- lib/resize.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-resize.md b/docs/api-resize.md index af8c2c6b..80252ff3 100644 --- a/docs/api-resize.md +++ b/docs/api-resize.md @@ -53,7 +53,7 @@ Previous calls to `resize` in the same pipeline will be ignored. | [options.kernel] | String | 'lanczos3' | the kernel to use for image reduction. Use the `fastShrinkOnLoad` option to control kernel vs shrink-on-load. | | [options.withoutEnlargement] | Boolean | false | do not enlarge if the width *or* height are already less than the specified dimensions, equivalent to GraphicsMagick's `>` geometry option. | | [options.withoutReduction] | Boolean | false | do not reduce if the width *or* height are already greater than the specified dimensions, equivalent to GraphicsMagick's `<` geometry option. | -| [options.fastShrinkOnLoad] | Boolean | true | take greater advantage of the JPEG and WebP shrink-on-load feature, which can lead to a slight moiré pattern on some images. | +| [options.fastShrinkOnLoad] | Boolean | true | take greater advantage of the JPEG and WebP shrink-on-load feature, which can lead to a slight moiré pattern or round-down of an auto-scaled dimension. | **Example** ```js diff --git a/lib/resize.js b/lib/resize.js index 47127991..8d67ede4 100644 --- a/lib/resize.js +++ b/lib/resize.js @@ -227,7 +227,7 @@ function isResizeExpected (options) { * @param {String} [options.kernel='lanczos3'] - the kernel to use for image reduction. Use the `fastShrinkOnLoad` option to control kernel vs shrink-on-load. * @param {Boolean} [options.withoutEnlargement=false] - do not enlarge if the width *or* height are already less than the specified dimensions, equivalent to GraphicsMagick's `>` geometry option. * @param {Boolean} [options.withoutReduction=false] - do not reduce if the width *or* height are already greater than the specified dimensions, equivalent to GraphicsMagick's `<` geometry option. - * @param {Boolean} [options.fastShrinkOnLoad=true] - take greater advantage of the JPEG and WebP shrink-on-load feature, which can lead to a slight moiré pattern on some images. + * @param {Boolean} [options.fastShrinkOnLoad=true] - take greater advantage of the JPEG and WebP shrink-on-load feature, which can lead to a slight moiré pattern or round-down of an auto-scaled dimension. * @returns {Sharp} * @throws {Error} Invalid parameters */