Write JPEG
Controlled node
Overview
The Write JPEG node saves image data as a JPEG file in the project library. It is useful at the end of an image workflow when you want to export a processed image, generated image, or base64 image payload as a library file.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the JPEG creation and upload. | - |
| Data | Data | The image data to save. Supports a Jimp image object, base64 string, or Buffer. | - |
| Name | Data | The filename for the generated image. If the name does not end with .jpeg or .jpg, .jpeg is appended automatically. | - |
| Path | Data | Optional folder path in the library where the JPEG should be saved. Missing folders are created automatically. If omitted, the file is saved in the root library folder. | root |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the node has finished running. |
| File | Data | The generated library file reference. If image processing or upload fails, this output contains an error object. |
Runtime Behavior and Defaults
- Controlled Node: The node runs only when the Run event fires.
- Project Requirement: A runtime project ID is required so the JPEG can be uploaded to the project library.
- Filename Handling: The node requires a non-empty Name input.
.jpegis appended if neither.jpegnor.jpgis present. - Directory Creation: If Path is provided, the node creates or resolves that library folder path before uploading.
- Image Conversion: Jimp images are encoded as JPEG. Base64 strings and Buffers are uploaded as image buffers.
- Error Handling: If data, project ID, filename, image processing, or upload fails, File contains an error object instead of a file reference.
Example Usage
Export a Processed Image
- Use Read Image to load a library image.
- Process it with Resize Image, Crop Image, or another image-processing node.
- Connect the processed image to Data.
- Set Name to
"processed-image". - Optionally set Path to
"exports/images". - Trigger Run from a Start node or another event.
The node saves processed-image.jpeg to the library and outputs the generated file reference.
tip
Use Get Library Download URLs after this node if you need a downloadable link for the generated JPEG.