Media
Redimensionner les images WebP en conservant le format et la qualité WebP
Appelez cet outil depuis votre code en trois langages.
# 1) Request a presigned URL → returns { uploadUrl, storageKey }
curl -X POST 'https://api.elysiatools.com/api/upload/presign/webp-to-resized-webp' \
-H 'Content-Type: application/json' \
-d '{"filename":"imageFile.ext","contentType":"application/octet-stream","size":12345}'
# 2) PUT the file bytes directly to the presigned uploadUrl
curl -X PUT '<presigned uploadUrl>' \
--data-binary @/path/to/file.ext
# 3) Call the tool, passing the returned storageKey for each file field
curl -X POST 'https://api.elysiatools.com/fr/api/tools/webp-to-resized-webp' \
-F 'imageFile=uploads/2026/01/01/your-tool-1700000000000-abc123.ext' \
-F 'width=0' \
-F 'height=0' \
-F 'fit=cover' \
-F 'position=center' \
-F 'background=transparent' \
-F 'quality=90' \
-F 'withoutEnlargement=false'Envoyez une requête POST avec vos entrées en JSON. Les paramètres de type fichier nécessitent un upload préalable.
POST https://api.elysiatools.com/fr/api/tools/webp-to-resized-webp| Nom | Type | Requis | Description |
|---|---|---|---|
| imageFile | fileupload requis | Oui | — |
| width | number | Non | Laisser vide pour calculer automatiquement basé sur la hauteur et le ratio |
| height | number | Non | Laisser vide pour calculer automatiquement basé sur la largeur et le ratio |
| fit | select | Non | — |
| position | select | Non | — |
| background | text | Non | Couleur de fond pour l'espace vide. Utiliser le format #RRGGBB ou "transparent" |
| quality | range | Non | — |
| withoutEnlargement | checkbox | Non | Prévenir l'agrandissement quand les dimensions cibles sont plus grandes que l'original |
Résultat fichier
{
"filePath": "/public/processing/randomid.ext",
"fileName": "output.ext",
"contentType": "application/octet-stream",
"size": 1024,
"metadata": {
"key": "value"
},
"error": "Error message (optional)",
"message": "Notification message (optional)"
}Ajoutez cet outil à votre serveur Model Context Protocol pour que les agents IA puissent le lister et l'appeler.
Ajoutez ce bloc à la configuration de votre client MCP :
{
"mcpServers": {
"elysiatools-webp-to-resized-webp": {
"name": "webp-to-resized-webp",
"description": "Redimensionner les images WebP en conservant le format et la qualité WebP",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=webp-to-resized-webp",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}Après connexion au point d'accès SSE, listez les outils exposés :
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Appelez l'outil par son id ; les arguments sont construits à partir de ses paramètres :
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "webp-to-resized-webp",
"arguments": {
"imageFile": "https://example.com/file.ext",
"width": 0,
"height": 0,
"fit": "cover",
"position": "center",
"background": "transparent",
"quality": 90,
"withoutEnlargement": false
}
}
}Des questions ou un problème ? Contactez [email protected]