resize_image
Resize local images by percentage or specific pixel dimensions, with optional aspect ratio maintenance, and save the output to disk.
Instructions
Resize a local image using the PDF4me ResizeImage API (Percentage or Specific dimensions). Provide the image path, resize mode, and options (percentage or width/height, aspect ratio). Optional output directory and file name; saves the resized image to disk.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | Target width in pixels when using Specific mode. | |
| height | No | Target height in pixels when using Specific mode. | |
| file_path | Yes | Local path to the source image. | |
| output_dir | No | ||
| output_file_name | No | ||
| image_resize_type | No | Percentage (ResizePercentage) or Specific (Width/Height in pixels). | Percentage |
| resize_percentage | No | Used when image_resize_type is Percentage (decimal string, e.g. "50.0"). | 50.0 |
| maintain_aspect_ratio | No | Passed through to the API. |