0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions132

Image → Rotate Image

AI-generated

Overview

The node provides an image rotation utility as part of a broader no-code toolbox. It allows users to rotate images by a specified angle, either by providing a publicly accessible image URL or by supplying the image data directly as a base64-encoded buffer. This is useful in scenarios where images need to be programmatically adjusted for orientation before further processing or display, such as correcting photo orientations, preparing images for reports, or standardizing image layouts.

Practical examples:

  • Rotating user-uploaded photos to the correct orientation before saving.
  • Adjusting scanned document images by 90, 180, or 270 degrees.
  • Preparing images for thumbnails or previews with specific rotation requirements.

Properties

Name Meaning
Data Type Choose the source type of the image data: "URL" (publicly accessible image URL) or "Buffer" (base64-encoded image data).
Image URL The URL of the image to rotate. Must be publicly accessible. Only shown if Data Type is "URL".
Image Buffer Base64-encoded image data to rotate. Only shown if Data Type is "Buffer".
Rotation Angle The angle in degrees to rotate the image. Positive values rotate clockwise. Common values are 90, 180, and 270.

Output

The node outputs JSON data representing the rotated image. The exact structure is not detailed in the provided code, but typically it would include either a URL to the rotated image or the rotated image data encoded in base64 format. If binary data output is supported, it would represent the rotated image file ready for downstream use.

Dependencies

  • Requires an API key credential for authentication with the external service at https://prod.0codekit.com.
  • The node sends a POST request to the /image/rotate endpoint of this service with the input parameters.
  • The image URL must be publicly accessible if using the URL data type.
  • No other external dependencies are indicated.

Troubleshooting

  • Common issues:

    • Providing a non-public or inaccessible image URL will cause the rotation to fail.
    • Supplying invalid base64 data in the buffer field may result in errors.
    • Using unsupported rotation angles might lead to unexpected results; stick to common angles like 90, 180, or 270.
    • Missing or invalid API credentials will prevent the node from authenticating with the service.
  • Error messages:

    • Errors related to network connectivity or invalid URLs usually indicate that the image cannot be fetched.
    • Authentication errors suggest problems with the API key configuration.
    • Malformed input data errors point to incorrect base64 encoding or missing required fields.

To resolve these, ensure the image URL is accessible, the base64 data is correctly formatted, the rotation angle is valid, and the API key credential is properly set up in n8n.

Links and References

Discussion