- Source:
Methods
(static) imageForSize(image, options) → {String}
Generates the image src for a resized image with maximum dimensions maxWidth
and maxHeight
.
Images do not scale up.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
image |
Object | The original image model to generate the image src for. |
|||||||||
options |
Object | An options object containing: Properties
|
- Source:
Returns:
The image src for the resized image.
- Type
- String
Example
const url = client.image.helpers.imageForSize(product.variants[0].image, {maxWidth: 50, maxHeight: 50});