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

This node operation "Rotate Image By EXIF Data" processes an image file and automatically rotates it according to its embedded EXIF orientation metadata. This is useful when images are taken with devices that store orientation information in EXIF tags rather than physically rotating the pixels, ensuring the output image appears correctly oriented without manual rotation.

Common scenarios include:

  • Automatically correcting photos uploaded from cameras or smartphones before further processing.
  • Preparing images for display or printing where correct orientation is critical.
  • Integrating into workflows that handle image uploads to normalize orientation.

For example, a user can input an image as binary data from a previous node, a base64 string, or a URL, and receive back a rotated image file with the proper orientation applied.

Properties

Name Meaning
Input Data Type Choose how to provide the image file:
- Binary Data (image from previous node)
- Base64 String (base64 encoded image content)
- URL (link to image file)
Input Binary Field Name of the binary property containing the image file (used only if Input Data Type is Binary Data)
Base64 Image Content Base64 encoded image content (used only if Input Data Type is Base64 String)
Image URL URL to the image file (used only if Input Data Type is URL)
Output File Name Desired filename for the rotated output image file
Async Enable asynchronous processing (true/false)

Output

The node outputs the rotated image file in binary format under the specified output file name. The json output field contains metadata about the processed image, typically including the filename and possibly other relevant details. The binary data represents the image after rotation based on EXIF orientation.

If the input was binary or base64, the output will be a binary file with corrected orientation. If the input was a URL, the image is fetched, rotated, and returned similarly.

Dependencies

  • Requires access to image processing capabilities that can read EXIF metadata and rotate images accordingly.
  • May require internet access if the input is provided as a URL.
  • No explicit external API keys or credentials are indicated by the static code.
  • The node supports asynchronous processing which may require appropriate n8n environment settings for async execution.

Troubleshooting

  • Common issues:

    • Invalid or missing EXIF data in the image may result in no rotation or incorrect rotation.
    • Providing an incorrect binary property name will cause the node to fail to find the image data.
    • If using a URL, network issues or invalid URLs will cause errors fetching the image.
    • Large images might cause performance delays or timeouts if async processing is disabled.
  • Error messages:

    • Errors related to missing binary data or invalid base64 strings indicate input data problems.
    • Network errors when fetching URLs should be checked for connectivity and URL correctness.
    • If the node throws errors about unsupported image formats, ensure the input image is in a supported format.
  • Resolutions:

    • Verify the input data type matches the actual input.
    • Confirm the binary property name matches the incoming data structure.
    • Check URLs for accessibility.
    • Enable async processing for large files or slow networks.

Links and References

Discussion