Constructor
new ImageResize(parametersopt)
Creates an instance of ImageResize
and checks for invalid parameters
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object |
<optional> |
Parameters holder
Properties
|
- Source:
Methods
height(value) → {ImageResize}
Set the resized images height
Parameters:
Name | Type | Description |
---|---|---|
value |
Number |
- Source:
Returns:
The current ImageResize
- Type
- ImageResize
keepAspectRatio(value) → {ImageResize}
Sets wether the resized images should keep their initial aspect ratio
Parameters:
Name | Type | Description |
---|---|---|
value |
Boolean |
- Source:
Returns:
The current ImageResize
- Type
- ImageResize
maxheight(value) → {ImageResize}
Set the resized images max-height
Parameters:
Name | Type | Description |
---|---|---|
value |
Number |
- Source:
Returns:
The current ImageResize
- Type
- ImageResize
maxWidth(value) → {ImageResize}
Set the resized images max-width
Parameters:
Name | Type | Description |
---|---|---|
value |
Number |
- Source:
Returns:
The current ImageResize
- Type
- ImageResize
process(file) → {Promise}
Manually process an image
Parameters:
Name | Type | Description |
---|---|---|
file |
String | File | The image SRC or the image File itself |
- Source:
Returns:
Resolved with the new Image
- Type
- Promise
width(value) → {ImageResize}
Set the resized images width
Parameters:
Name | Type | Description |
---|---|---|
value |
Number |
- Source:
Returns:
The current ImageResize
- Type
- ImageResize