@fleek-platform/agents-ui
Version:
The Fleek Platform Agents UI provides a simple interface for deploying, monitoring, and configuring your agents––making management straightforward
20 lines (19 loc) • 866 B
TypeScript
export interface CroppedAreaPixels {
x: number;
y: number;
width: number;
height: number;
}
/**
* getCroppedImg crops the input image using the provided crop dimensions,
* then produces a fixed 100 x 100 image in WebP format. This implementation
* explicitly resets any canvas scaling (e.g., from devicePixelRatio) to ensure
* that the final output is exactly 100×100 pixels.
*
* @param imageSrc - The source of the image as a data URL.
* @param pixelCrop - The cropping dimensions in the image's natural pixel units.
* @param quality - Optional compression quality (0 to 1) for WebP format. Defaults to 0.75.
* @returns A Promise that resolves with the cropped image as a Base64 data URL.
*/
declare const getCroppedImg: (imageSrc: string, pixelCrop: CroppedAreaPixels, quality?: number) => Promise<string>;
export default getCroppedImg;