optimize_local_image
Convert local images to WebP with automatic EXIF rotation, resizing, and quality control to maintain consistent performance when replacing stock photos with client photos.
Instructions
Convert a local image file (e.g. a client-provided photo) to WebP with the same pipeline used by download_image: EXIF rotation, max-width resize, quality control. Use it when replacing stock photos with the client's real photos so performance stays consistent. Input must be a file inside the project directory.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| quality | No | ||
| filename | No | Output name without extension, kebab-case. Defaults to the source file name. | |
| maxWidth | No | ||
| inputPath | Yes | Relative path to the source image inside the project. | |
| outputDir | No | Relative directory inside the project to save the file. | public/images |
| overwrite | No |