Resize image
Resize and crop an image (via a URL). The image is returned as a base64 string or as a data URI that you can use directly in <img> tags. You can download this system service from Grexx Marketplace.
Input
Use a casetype activity to add inputs to the Start Systemservice resize image form.
| Attribute | Data type | Mandatory? | Description |
|---|---|---|---|
| Height | Integer | No | Height of the new image. Default: 512 |
| Operation | String | No | See supported values below. Default: focus |
| Type | String | No | Choice of: jpg, png, tiff, webp. Default: jpg |
| Width | Integer | No | Width of the new image. Default: 512 |
| URL | String | Yes | URL of the image you want to resize. For a file from your application, use file.tempUrl |
| Operation | Description |
|---|---|
| Focus | Crop the image to the desired dimensions with focus on the most interesting part of the image. |
| Crop | Crop the image to the desired dimensions with focus on the center of the image. |
| Embed | Make sure the image is within the desired dimensions and fill the rest with a black background. |
| Max | Resize the image within the same aspect ratio. |
Output
Outputs are added to the Result Systemservice resize image form when the Systemservice resize image case is closed.
| Attribute | Data type | Mandatory? | Description |
|---|---|---|---|
| Error | String | No | If something went wrong, the error message. |
| File | File | No | The resized image. |
| Result height | Integer | No | The final height (useful if Operation=max was applied). |
| Result width | Integer | No | The final width (useful if Operation=max was applied). |
| Size | Integer | No | The size in bytes of the resized image. |