Class: ImageResize

ImageResize(parametersopt)

ImageResize Class used to handle the resizing

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
Name Type Attributes Default Description
source String | Element <optional>
Input to automatically resize
keepAspectRatio Boolean <optional>
true Keep the aspect ratio ?
maxWidth Number <optional>
Image max width
maxHeight Number <optional>
Image max height
width Number <optional>
Image fixed width
height Number <optional>
Image fixed width
onResize function <optional>
Resize callback
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