Actions4
Overview
This node, named "Image Processor," provides various image processing capabilities using the sharp library. It supports operations such as converting image formats, reading image information including EXIF metadata, resizing images, and cropping images. The node is useful in workflows where automated image manipulation or analysis is required, for example:
- Extracting metadata and EXIF information from uploaded photos to catalog or analyze them.
- Converting images between formats like JPEG, PNG, WebP, AVIF, or TIFF.
- Resizing images to specific dimensions or maximum size constraints for thumbnails or optimized web delivery.
- Cropping images to focus on particular areas.
The operation "读取图片信息和EXIF" (read image info and EXIF) specifically reads basic image details and optionally includes EXIF metadata with configurable encoding.
Properties
| Name | Meaning |
|---|---|
| Operation | The image processing operation to perform. Options: Convert format, Read image info and EXIF, Resize, Crop. |
| 包含EXIF信息 (includeExif) | Whether to include EXIF information and its decoded encoding in the output metadata when reading image info. |
| EXIF编码格式 (exifEncoding) | Encoding format used when EXIF data is a Buffer. Options: UTF-8, ASCII, GB2312, GBK, Latin1, Hex, Base64, Raw object. |
| Input Type | Type of input image data. Options: File Path, Base64 string, Binary Data. |
| Source Path | Path to the source image file (required if Input Type is File Path). |
| Base64 Image | Base64 encoded image data (required if Input Type is Base64). |
| Binary Property | Name of the binary property containing image data (required if Input Type is Binary Data). |
| Format | Output image format for applicable operations. Options: JPEG, PNG, WebP, WebP lossless, AVIF, TIFF, Same as source file. |
| Quality | Quality of the output image (1-100), relevant for lossy formats like JPEG or WebP. |
Additional properties exist for other operations (resize, crop, convert) but are not relevant here.
Output
The node outputs an array of items, each containing a json field with the results of the operation. For the "读取图片信息和EXIF" operation, the output JSON includes:
- Basic image information such as dimensions, format, size.
- If enabled, EXIF metadata decoded according to the selected encoding format.
- Metadata fields may contain additional descriptive information if provided.
No binary output is produced by this operation since it only reads and returns metadata.
Dependencies
- Uses the sharp library internally for image processing.
- Requires access to the image data either via file path, base64 string, or binary data input.
- No external API keys or services are needed.
- Proper file system permissions are necessary if using file path input.
Troubleshooting
- File Not Found: If using file path input, ensure the specified path is correct and accessible.
- Invalid Base64 Data: When providing base64 input, verify the string is properly encoded.
- Unsupported Image Format: The node supports common formats; unsupported or corrupted images may cause errors.
- EXIF Decoding Errors: Selecting an incorrect EXIF encoding may result in unreadable metadata; try different encodings if data appears garbled.
- Memory Issues: Processing very large images might consume significant memory; consider resizing before processing if possible.
Common error messages will typically indicate the nature of the failure (e.g., file access issues, decoding problems) and can be resolved by checking inputs and configurations.
Links and References
- sharp - High performance Node.js image processing
- EXIF metadata standards and common tags: https://exiftool.org/TagNames/EXIF.html