Outils image
Resize Image
resize-image
Use Resize Image through the Zavilo SDK. Check input limits, parameters, output and supported modes below.
H · Headless
Accès rapide
Fichiers d’entrée 1Fichiers de sortie 1
Entrée
Formats d’entrée et nombre de fichiers acceptés par cette Tool.
| Type d’entrée | file |
|---|---|
| Nombre de fichiers | 1 – 1 |
| MIME acceptés | image/jpeg, image/png, image/webp |
Paramètres
Transmettez ces valeurs via request.options.
| Paramètre | Type | Obligatoire | Par défaut | Valeurs / Plage | Description |
|---|---|---|---|---|---|
width |
integer | Optionnel | — | 1 – 16384 | Target width in pixels. At least width or height is required. |
height |
integer | Optionnel | — | 1 – 16384 | Target height in pixels. At least width or height is required. |
keepAspectRatio |
boolean | Optionnel | true |
— | Preserve aspect ratio. When width and height are both provided, fit inside that box. |
format |
enum | Optionnel | original |
original | jpg | png | webp | Output image format. |
quality |
number | Optionnel | 0.92 |
0.5 – 1 | Output quality from 0.5 to 1.0. |
Sortie
Format du résultat renvoyé après traitement.
| Type | files |
|---|---|
| Nombre de fichiers | 1 – 1 |
| MIME de sortie | image/jpeg, image/png, image/webp |
| Metadata | width, height, inputBytes, outputBytes |
| Archive ZIP | Non pris en charge |
Utilisation de base
Choisissez un mode pris en charge et copiez le code de démarrage généré.
Headless
const result = await client.run("resize-image", {
file,
options: { keepAspectRatio: true, format: "original" }
});
console.log(result.files, result.data, result.metadata);
Embedded
await client.mount({ tool: "resize-image", target: "#zavilo-tool", mode: "embedded" });
This page is generated from the SDK Tool Definition used by the runtime.