Actions108
- AI Actions
- Transcribe
- Detect Brand
- Extract Contact Information
- Mood Detection
- Detect Adult Content
- Enitity Detection
- Language Detection
- Too Long To Read
- Check Content Policy
- Detect Faces
- Generate Python Code
- Picture Text Recognition
- Detect Color
- Generate Image
- PDF OCR
- Translation
- Detect Email Type
- Generate Javascript Code
- Picture Object Recognition
- Business Actions
- Calculate Actions
- Code Actions
- Convert Actions
- Crypto Actions
- Date & Time Actions
- Generate Actions
- Image Actions
- Operator Actions
- PDF Actions
- Storage Actions
- Text Actions
- User Actions
Overview
The "Image Resize" operation of this node allows users to resize images by specifying new dimensions and resizing options. It supports input images either as publicly accessible URLs or as raw buffers. This operation is useful in scenarios where you need to adjust image sizes for web optimization, thumbnails, previews, or preparing images for further processing or display.
For example, you might use this node to:
- Resize product images to a standard size before uploading them to an e-commerce site.
- Generate thumbnails from larger images for faster loading in galleries.
- Adjust image dimensions dynamically based on user input or workflow requirements.
Properties
| Name | Meaning |
|---|---|
| Type of Data | Choose whether the input image is provided as a URL (publicly accessible) or as a Buffer (raw data). |
| URL | The publicly accessible URL of the image to resize (required if "Type of Data" is URL). |
| Buffer | The raw buffer string of the image to resize (required if "Type of Data" is Buffer). |
| Width | The target width (in pixels) for the resized image. |
| Height | The target height (in pixels) for the resized image. |
| Fit | How the image should be fitted to the specified dimensions. Possible values: "contain", "cover", "fill", "inside", "outside". |
| Kernel | The kernel algorithm used for resizing. Possible values: "nearest", "cubic", "mitchell", "lanczos2", "lanczos3". |
| File Name | Optional filename for the image being processed. |
| Get File as URL | Boolean flag indicating whether the output image should be returned as a URL (true) or not (false). |
Additionally, there is support for defining code variables (Code Variables) that can be used when running code hosted on the platform, but this is not directly related to the resize operation.
Output
The node outputs JSON data representing the result of the resize operation. Typically, this will include either:
- A URL pointing to the resized image if
Get File as URLis true. - Or the image data in another form (e.g., base64 or buffer) if the URL option is false.
If binary data is involved, it represents the resized image content.
Dependencies
- Requires an API key credential for authentication with the external service providing the image processing capabilities.
- The input image URL must be publicly accessible if using the URL input type.
- No other explicit dependencies are indicated in the source code.
Troubleshooting
Common issues:
- Providing a non-public or inaccessible URL will cause the operation to fail because the service cannot fetch the image.
- Incorrect or missing width/height parameters may lead to unexpected results or errors.
- Using an unsupported fit or kernel value could cause the request to be rejected.
- If the buffer input is malformed or incorrectly encoded, the resize operation will fail.
Error messages:
- Errors related to fetching the image URL usually indicate access or network issues; ensure the URL is correct and publicly reachable.
- Validation errors about missing required parameters like width or height mean those inputs must be provided.
- Authentication errors suggest the API key credential is missing or invalid.
Links and References
- n8n Expressions Documentation — for using expressions in variable fields.
- Image resizing concepts such as "fit" and "kernel" can be explored in image processing libraries documentation like Sharp.js or similar.