Add docs for new ignoreAspectRatio option

This commit is contained in:
Lovell Fuller 2015-04-16 18:28:30 +01:00
parent 3dfc7bea3a
commit ba034a8164
2 changed files with 8 additions and 0 deletions

View File

@ -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`. 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) #### background(rgba)
Set the background for the `embed` and `flatten` operations. Set the background for the `embed` and `flatten` operations.

View File

@ -185,6 +185,10 @@ Sharp.prototype.min = function() {
return this; 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() { Sharp.prototype.ignoreAspectRatio = function() {
this.options.canvas = 'ignore_aspect'; this.options.canvas = 'ignore_aspect';
return this; return this;