1001fx - NoCode functions icon

1001fx - NoCode functions

1001fx is a set of functions for any automation platform. Our functions are simple, very well tested, scalable and offer features that most automation platforms do not offer.

Actions74

images → Scale an Image to Fit Given Dimensions

AI-generated

Overview

This node allows you to scale an image to fit within specified width and height dimensions. It is useful in scenarios where you need to resize images for web uploads, thumbnails, or any automation that requires images to conform to certain size constraints. For example, you might use this node to automatically resize user-uploaded profile pictures or to prepare product images for an e-commerce platform.

Properties

Name Meaning
Width The width to scale the image to (must be between 1 and 10,000 pixels).
Height The height to scale the image to (must be between 1 and 10,000 pixels).
Image file Image file to be processed.
Binary Property Name of the binary property to which to write the data of the processed image file.

Output

  • Binary Data:
    The output will contain a binary field with the name specified in "Binary Property". This field holds the scaled image file.

    • The original binary data (if present) is preserved alongside the new scaled image.
    • The filename and content type are set according to the processed image.
  • JSON Field:
    The json field is passed through from the input item and may include an error message if processing fails.

Dependencies

  • External Service: Requires access to the 1001fx API.
  • API Key: You must configure the 1001fxApi credential in n8n.
  • Environment: No additional environment variables are required beyond standard n8n configuration.

Troubleshooting

  • Common Issues:

    • Invalid Dimensions: If "Width" or "Height" are outside the allowed range (1–10,000), the API may return an error.
    • Missing Binary Data: If the specified "Image file" is not found in the input item's binary properties, the node will fail.
    • Authentication Errors: If the 1001fxApi credential is missing or invalid, requests will fail with authentication errors.
  • Error Messages:

    • "error": "Cannot read property 'fileName' of undefined": Indicates the specified binary property does not exist on the input item.
    • "error": "Request failed with status code 401": Check your API credentials.
    • Other errors returned by the API will appear in the json.error field.

Links and References

Discussion