image_rotate
Rotate a single image by 90-degree increments.
Parameters
- pathstringone of
pathorsource_key - Source image path
- source_keystringone of
pathorsource_key - Context key containing a source path/object
- output_pathstringrequired
- Destination image path
- anglenumberdefault 90
- One of
90,180,270 - formatstringdefault inferred / png
pngorjpeg/jpg- output_keystringdefault "rotated_image"
- Prefix for output values
Context Output
<output_key>— output file path<output_key>_angle— angle used<output_key>_width/<output_key>_height— output dimensions<output_key>_source_width/<output_key>_source_height<output_key>_format<output_key>_success
Example
local flow = Flow.new("image_rotate_demo")
flow:step("rotate", nodes.image_rotate({
path = "examples/fixtures/ironflow-sample.png",
angle = 90,
output_path = "output/sample_front_rotated.png",
output_key = "rotated"
}))
flow:step("log", nodes.log({
message = "Rotated image: ${ctx.rotated_width}x${ctx.rotated_height}"
})):depends_on("rotate")
return flow