From c9bff94e17b29fb743436e42102aaf213e0d74ae Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sat, 14 Mar 2020 21:34:48 +0000 Subject: [PATCH] Docs: expand descriptions of resize cover/contain --- docs/api-resize.md | 4 ++-- lib/resize.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/api-resize.md b/docs/api-resize.md index adb9488c..71438b4b 100644 --- a/docs/api-resize.md +++ b/docs/api-resize.md @@ -6,8 +6,8 @@ Resize image to `width`, `height` or `width x height`. When both a `width` and `height` are provided, the possible methods by which the image should **fit** these are: -- `cover`: Crop to cover both provided dimensions (the default). -- `contain`: Embed within both provided dimensions. +- `cover`: (default) Preserving aspect ratio, ensure the image covers both provided dimensions by cropping/clipping to fit. +- `contain`: Preserving aspect ratio, contain within both provided dimensions using "letterboxing" where necessary. - `fill`: Ignore the aspect ratio of the input and stretch to both provided dimensions. - `inside`: Preserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to both those specified. - `outside`: Preserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to both those specified. diff --git a/lib/resize.js b/lib/resize.js index 7e2f4b74..f03ce480 100644 --- a/lib/resize.js +++ b/lib/resize.js @@ -96,8 +96,8 @@ function isRotationExpected (options) { * Resize image to `width`, `height` or `width x height`. * * When both a `width` and `height` are provided, the possible methods by which the image should **fit** these are: - * - `cover`: Crop to cover both provided dimensions (the default). - * - `contain`: Embed within both provided dimensions. + * - `cover`: (default) Preserving aspect ratio, ensure the image covers both provided dimensions by cropping/clipping to fit. + * - `contain`: Preserving aspect ratio, contain within both provided dimensions using "letterboxing" where necessary. * - `fill`: Ignore the aspect ratio of the input and stretch to both provided dimensions. * - `inside`: Preserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to both those specified. * - `outside`: Preserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to both those specified.