PDF4me icon

PDF4me

Comprehensive PDF and document processing: generate barcodes, convert files, extract data, manipulate images, and automate workflows with the PDF4ME API

Actions80

Overview

The node provides an image resizing operation that allows users to resize images in various input formats. It supports resizing by a percentage scale or by specifying exact dimensions (width and height). The node can maintain the aspect ratio of the image during resizing if desired. This functionality is useful for workflows that require image optimization, thumbnail generation, or preparing images for web or print with specific size requirements.

Common scenarios include:

  • Automatically resizing user-uploaded images before storage or display.
  • Creating thumbnails from larger images.
  • Adjusting image sizes for email attachments or social media posts.
  • Batch processing images in automation workflows.

Properties

Name Meaning
Input Data Type Choose how to provide the image file to resize: "Binary Data" (from previous node), "Base64 String", or "URL".
Input Binary Field Name of the binary property containing the image file (used if Input Data Type is "Binary Data").
Base64 Image Content Base64 encoded string of the image content (used if Input Data Type is "Base64 String").
Image URL URL pointing to the image file to resize (used if Input Data Type is "URL").
Output File Name Desired name for the output resized image file.
Resize Type Method of resizing: "Percentage" to scale by percent, or "Specific" to set exact width and height.
Resize Percentage Percentage value to resize the image by (used if Resize Type is "Percentage").
Width Target width in pixels (used if Resize Type is "Specific").
Height Target height in pixels (used if Resize Type is "Specific").
Maintain Aspect Ratio Boolean flag to keep the original aspect ratio when resizing.
Async Enable asynchronous processing of the resizing operation.
Binary Data Output Name Custom name for the binary data field in the node's output.

Output

The node outputs the resized image as binary data under the specified binary data output name (default is "data"). The output includes:

  • A JSON object representing the processed item.
  • A binary property containing the resized image file data.
  • The output file name as specified in the properties.

This allows subsequent nodes in the workflow to access the resized image either for further processing or for saving/exporting.

Dependencies

  • The node requires access to image data either via binary input, base64 string, or URL.
  • No explicit external API keys or services are indicated in the source code; the resizing logic is handled internally or via bundled dependencies.
  • Proper configuration of input data sources (e.g., previous nodes providing binary data or valid URLs) is necessary.

Troubleshooting

  • Invalid Input Data: If the input image data is missing or malformed (e.g., invalid base64 string or inaccessible URL), the node may fail. Ensure the input data matches the selected input type.
  • Unsupported Image Formats: The node might not support all image formats. Use common formats like JPEG, PNG, or GIF.
  • Aspect Ratio Issues: When "Maintain Aspect Ratio" is enabled but specific width and height are provided, the actual output size may differ from the requested dimensions.
  • Async Processing: If asynchronous processing is enabled, ensure downstream nodes handle asynchronous outputs correctly.
  • File Naming Conflicts: Duplicate output file names in batch operations could cause confusion; use unique names if needed.

Error messages typically relate to invalid inputs or processing failures. To resolve, verify input correctness, network accessibility for URLs, and proper configuration of properties.

Links and References

Discussion