Sprig Fit Images

v0.1.2
io.github.BillyQin/sprig-fit Checked 4 days ago Published 1 month ago

Inspect local photos and crop, resize or compress images to exact dimensions and file-size limits.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

inspect_image Inspect image

Read a local static JPEG/PNG/WebP image. Return EXIF-oriented width/height, actual bytes, MIME type and transparency, without exposing source EXIF. Optionally attach a small JPEG preview for crop planning.

ParameterTypeDescription
source *object
include_previewbooleanAttach a small JPEG preview for visual crop planning; the original is never embedded.

prepare_image Prepare image

Crop, resize, convert and compress one local image. Keep the full original when size/crop are omitted. Percent crop coordinates refer to the EXIF-oriented original; fitting happens after extraction. Exact max_bytes includes metadata. Default conflict_policy=error never silently reduces requested dimensions. JPEG transparency/letterboxing requires an explicit background. Save a NEW local file and return its actual dimensions, bytes and file resource. No image uploads or external service calls.

ParameterTypeDescription
format *string
source *object
allow_upscaleboolean
anchorstring
backgroundstringExplicit opaque background for JPEG transparency or letterboxing.
conflict_policystringerror preserves requested dimensions; shrink permits proportional downscaling to meet max_bytes.
cropobjectPercentages (0–100) of the EXIF-oriented original; extraction happens before fitting.
fitstring
max_bytesintegerMaximum actual output bytes including density metadata; 1 KB = 1000 bytes.
sizeobjectOmit to keep original/cropped dimensions. One dimension derives the other proportionally. Inch values are multiplied by PPI and rounded.