mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Docs: expand descriptions of resize cover/contain
This commit is contained in:
parent
e78e919925
commit
c9bff94e17
@ -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:
|
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).
|
- `cover`: (default) Preserving aspect ratio, ensure the image covers both provided dimensions by cropping/clipping to fit.
|
||||||
- `contain`: Embed within both provided dimensions.
|
- `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.
|
- `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.
|
- `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.
|
- `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.
|
||||||
|
@ -96,8 +96,8 @@ function isRotationExpected (options) {
|
|||||||
* Resize image to `width`, `height` or `width x height`.
|
* 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:
|
* 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).
|
* - `cover`: (default) Preserving aspect ratio, ensure the image covers both provided dimensions by cropping/clipping to fit.
|
||||||
* - `contain`: Embed within both provided dimensions.
|
* - `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.
|
* - `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.
|
* - `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.
|
* - `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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user