imgResize

Resize selected supported images without cropping while preserving aspect ratio.

Function

imgResize(width=1920, height=1080, source=None)

Parameters

width

Type: int, default 1920

Maximum output width in pixels. Must be greater than zero.

height

Type: int, default 1080

Maximum output height in pixels. Must be greater than zero.

source

Type: path, iterable of paths, or None

Optional image input. If omitted, all supported images in the current folder are discovered.

Returns

A list of `Path` objects for the resized images, or `None` when no images are found.

Examples

Resize all images

imgResize()

Resize to HD bounds

imgResize(1920, 1080)

Pass resized images to a PDF

imgTopdf(source=imgResize(1280, 720))

Notes

The function uses contain-style resizing, so the image is not cropped.

Dynamic input behavior

When source is omitted, Toolvix discovers matching files in the current working folder. When source is supplied, only the supplied files are processed. This makes nested pipelines deterministic.

Back to function index · Nesting and chaining