Media
Redimensionner les images WebP en conservant le format et la qualité WebP
Appelez cet outil depuis votre code en trois langages.
# 1) Upload each file first → returns { filePath }
curl -X POST 'https://api.elysiatools.com/upload/webp-to-resized-webp' \
-F 'file=@/path/to/imageFile.ext'
# 2) Call the tool with the returned filePath values
curl -X POST 'https://api.elysiatools.com/fr/api/tools/webp-to-resized-webp' \
-F 'imageFile=/path/to/file.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 |
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
}
}
}| — |
| 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)"
}Des questions ou un problème ? Contactez [email protected]