imageport

v0.1.0
io.github.CloudCorpRecords/imageport Checked 4 days ago Published 1 month ago

Local image tools via ImageMagick: metadata, resize, convert, crop, rotate.

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

get_image_metadata

Read metadata for an image file: format, width, height, color space, and file size.

ParameterTypeDescription
input *stringPath to the image file to read metadata from.

resize_image

Resize an image to the given width and/or height, preserving aspect ratio, and write it to the output path.

ParameterTypeDescription
input *stringPath to the source image file to resize.
output *stringPath where the resized image will be written.
heightnumberTarget height in pixels. Optional; at least one of width and height is required, and aspect ratio is preserved.
widthnumberTarget width in pixels. Optional; at least one of width and height is required, and aspect ratio is preserved.

convert_image

Convert an image to another format (png, jpg, webp, gif, avif, bmp, tiff) and write it to the output path.

ParameterTypeDescription
format *stringTarget image format: one of png, jpg, webp, gif, avif, bmp, or tiff.
input *stringPath to the source image file to convert.
output *stringPath where the converted image will be written. Its extension is replaced by the target format when they differ.

crop_image

Crop a width x height region starting at offset x, y and write it to the output path.

ParameterTypeDescription
height *numberHeight in pixels of the crop region. Must be greater than 0.
input *stringPath to the source image file to crop.
output *stringPath where the cropped image will be written.
width *numberWidth in pixels of the crop region. Must be greater than 0.
x *numberHorizontal offset in pixels of the crop region's starting corner. Must be 0 or greater.
y *numberVertical offset in pixels of the crop region's starting corner. Must be 0 or greater.

rotate_image

Rotate an image by the given angle in degrees and write it to the output path.

ParameterTypeDescription
angle *numberRotation angle in degrees.
input *stringPath to the source image file to rotate.
output *stringPath where the rotated image will be written.