mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 02:30:12 +02:00
Add docs for new ignoreAspectRatio option
This commit is contained in:
parent
3dfc7bea3a
commit
ba034a8164
@ -389,6 +389,10 @@ the `width` and `height` specified.
|
||||
|
||||
Both `width` and `height` must be provided via `resize` otherwise the behaviour will default to `crop`.
|
||||
|
||||
#### ignoreAspectRatio()
|
||||
|
||||
Ignoring the aspect ratio of the input, stretch the image to the exact `width` and/or `height` provided via `resize`.
|
||||
|
||||
#### background(rgba)
|
||||
|
||||
Set the background for the `embed` and `flatten` operations.
|
||||
|
4
index.js
4
index.js
@ -185,6 +185,10 @@ Sharp.prototype.min = function() {
|
||||
return this;
|
||||
};
|
||||
|
||||
/*
|
||||
Ignoring the aspect ratio of the input, stretch the image to
|
||||
the exact width and/or height provided via the resize method.
|
||||
*/
|
||||
Sharp.prototype.ignoreAspectRatio = function() {
|
||||
this.options.canvas = 'ignore_aspect';
|
||||
return this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user