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

AI-generated

Overview

The "Scale an Image" operation in the images resource of this n8n node allows you to resize an image by a specified scaling factor. This is useful for automating image processing tasks such as preparing images for web use, generating thumbnails, or batch-resizing images before uploading them to other services.

Practical examples:

  • Automatically resizing user-uploaded profile pictures to fit a standard size.
  • Scaling down large images before sending them via email or storing them in a database.
  • Creating smaller preview versions of product images for an e-commerce site.

Properties

Name Meaning
Factor The factor to scale the image by (e.g., 0.5 to reduce size by half, 2 to double size).
Image file Image file to be processed.
Binary Property Name of the binary property to which to write the data of the processed image.

Output

  • The output will contain a binary field with the scaled image data.
  • The name of the binary property containing the output image is determined by the Binary Property input (default: data).
  • The binary data includes:
    • The scaled image file.
    • Metadata such as filename and content type, preserved from the API response.

Example output structure:

{
  "json": { /* original item JSON */ },
  "binary": {
    "data": {
      "data": "<Buffer ...>", // The scaled image binary data
      "fileName": "scaled-image.jpg",
      "mimeType": "image/jpeg"
    }
  },
  "pairedItem": { "item": 0 }
}

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 the API key setup.

Troubleshooting

Common issues:

  • Invalid scaling factor: If the factor is not within the allowed range (0.000001 to 10), the API may return an error.
  • Missing or invalid image file: If the image file is not provided or is corrupted, the operation will fail.
  • Incorrect binary property name: If the specified binary property name does not match the expected input/output, the result may not be accessible in subsequent nodes.

Error messages:

  • "error": "Request failed with status code 400" – Check that all required properties are set correctly and the image file is valid.
  • "error": "Invalid API key" – Ensure your 1001fx API credentials are configured properly in n8n.
  • "error": "Cannot read property 'split' of undefined" – This may occur if the API response headers are missing; check the API service status.

Links and References

Discussion