Image Manager
Introduction
The Image Manager tool inspects and transforms images stored on any allowed disk. It uses Spatie Image, which can run on either Imagick or GD.
After any transformation, the resulting image is automatically attached to the agent's reply.
Drivers
LARACLAW_IMAGE_DRIVER=imagick
Valid values are imagick (default) and gd. Imagick supports more formats and produces higher quality output, but requires the imagick PHP extension.
Inspecting an Image
The info operation returns the image's width, height, MIME type, and file size:
| Parameter | Description |
|---|---|
disk | Storage disk |
path | Image file path |
Resizing and Cropping
| Operation | Parameters | Notes |
|---|---|---|
resize | disk, path, width and/or height | Aspect ratio is preserved when only one dimension is given |
crop | disk, path, width, height | Crops to exact dimensions from the center |
The output is saved alongside the source with a _resized or _cropped suffix, and attached to the reply.
Format Conversion
The convert operation changes the image format:
| Parameter | Description |
|---|---|
disk | Storage disk |
path | Source image path |
format | Target format: jpg, png, or webp |
The converted file is saved next to the original with the new extension.
Optimization
The optimize operation re-saves the image at a chosen quality level to reduce file size:
| Parameter | Description |
|---|---|
disk | Storage disk |
path | Source image path |
quality | Integer from 1 to 100 |
Rotating and Flipping
The orient operation rotates or flips the image:
| Parameter | Description |
|---|---|
disk | Storage disk |
path | Source image path |
orientation | One of: rotate_90, rotate_180, rotate_270, flip_horizontal, flip_vertical |
Returning Images in a Reply
Every write operation (resize, crop, orient, convert, optimize) automatically queues the resulting file for the connector to attach to the reply. The agent does not need a separate step.