Alle Tools›Crop Image
Bild-Tools

Crop Image

crop-image

Use Crop Image through the Zavilo SDK. Check input limits, parameters, output and supported modes below.

H · HeadlessI · InteractiveE · Embedded
Tool-IDcrop-image
Version1
AusführungCLIENT
ModiHeadless, Interactive, Embedded

Schnellzugriff

Eingabedateien 1Ausgabedateien 1

Eingabe

Zulässige Eingabeformate und Dateianzahl für dieses Tool.

Eingabetypfile
Dateianzahl1 – 1
Zulässige MIME-Typenimage/jpeg, image/png, image/webp

Parameter

Diese Werte über request.options übergeben.

Parameter Typ Erforderlich Standard Zulässig / Bereich Beschreibung
x integer Erforderlich — 0 – 16383 Crop left coordinate in source-image pixels.
y integer Erforderlich — 0 – 16383 Crop top coordinate in source-image pixels.
width integer Erforderlich — 1 – 16384 Crop width in pixels.
height integer Erforderlich — 1 – 16384 Crop height in pixels.
format enum Optional original original | jpg | png | webp Output image format.
quality number Optional 0.92 0.5 – 1 Output quality from 0.5 to 1.0.

Ausgabe

Nach erfolgreicher Verarbeitung zurückgegebenes Ergebnisformat.

Typfiles
Dateianzahl1 – 1
Ausgabe-MIMEimage/jpeg, image/png, image/webp
Metadatawidth, height, inputBytes, outputBytes
ZIP-ArchivNicht unterstützt

Grundlegende Verwendung

Unterstützten Integrationsmodus wählen und den erzeugten Starter-Code kopieren.

Headless

const result = await client.run("crop-image", {
  file,
  options: { x: 0, y: 0, width: 1, height: 1 }
});
console.log(result.files, result.data, result.metadata);

Interactive

await client.open({
  tool: "crop-image",
  input: { file },
  options: { x: 0, y: 0, width: 1, height: 1 },
  onComplete(result) { console.log(result.files, result.data, result.metadata); }
});

Embedded

await client.mount({ tool: "crop-image", target: "#zavilo-tool", mode: "embedded" });
This page is generated from the SDK Tool Definition used by the runtime.