0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions108

Overview

The node provides a versatile image processing utility within the "0CodeKit" toolbox, specifically supporting the "Convert" operation on images. It allows users to convert images between various formats such as GIF, JPEG, PNG, TIFF, and WEBP. The node can accept input images either as publicly accessible URLs or as raw buffers, making it flexible for different workflows. Additional options like including metadata in the output and specifying conversion parameters (e.g., quality) are supported.

This node is beneficial in scenarios where automated image format conversion is needed, such as preparing images for web optimization, converting user-uploaded images to a standard format, or integrating with other systems that require specific image types.

Practical examples:

  • Converting a PNG image URL to a compressed JPEG format with metadata stripped.
  • Taking an image buffer from a previous node and converting it to WebP format for better compression.
  • Adjusting image quality during conversion by passing custom options.

Properties

Name Meaning
Code Variables Allows defining multiple code variables by selecting variable names/IDs from a list or using expressions, each with a specified value. Useful when running code-related operations but not directly relevant for image conversion.
Type of Data Specifies the input type of the image data: either a publicly accessible URL or a raw buffer string.
URL The publicly accessible URL of the image to convert. Required if "Type of Data" is set to URL.
Buffer The raw buffer string of the image to convert. Required if "Type of Data" is set to Buffer.
Output Format The desired output image format after conversion. Options include GIF, JPEG, JPG, PNG, TIFF, and WEBP.
With Metadata Boolean flag indicating whether to include metadata in the converted image. Defaults to false (exclude).
Options JSON object for additional conversion options, e.g., quality settings. Default example is {"quality":40}.
File Name Optional filename for the image being processed.
Get File as URL Boolean flag indicating whether to return the converted image as a URL. Defaults to true.

Output

The node outputs a JSON array containing the result(s) of the conversion operation. Each item typically includes the converted image data, which may be provided as a URL or as binary data depending on the "Get File as URL" property.

If the output is returned as a URL, it points to the location where the converted image can be accessed. If binary data is returned, it represents the actual image file content in the chosen format.

Dependencies

  • Requires an API key credential for the "0CodeKit" service to perform the image conversion.
  • The input image URL must be publicly accessible if using the URL input type.
  • No additional environment variables are explicitly required beyond the API authentication.

Troubleshooting

  • Common issues:

    • Providing a non-public or inaccessible image URL will cause failures in fetching the image.
    • Incorrectly formatted buffer strings may lead to errors during conversion.
    • Unsupported or misspelled output formats will cause the operation to fail.
    • Passing invalid JSON in the "Options" field can cause parsing errors.
  • Error messages and resolutions:

    • "Image URL not accessible": Verify the URL is correct and publicly reachable.
    • "Invalid buffer data": Ensure the buffer string is correctly encoded and complete.
    • "Unsupported output format": Choose one of the supported formats listed in the properties.
    • "Failed to parse options JSON": Validate the JSON syntax in the options field.

Links and References

Discussion