expo-image-manipulator
Version:
Provides functions that let you manipulation images on the local file system, eg: resize, crop.
14 lines (13 loc) • 775 B
TypeScript
import type { ImageLoadOptions } from '../ImageManipulator.types';
export declare function getContext(canvas: HTMLCanvasElement): CanvasRenderingContext2D;
export declare function blobToBase64String(blob: Blob): Promise<string>;
export declare function releaseCanvas(canvas: HTMLCanvasElement): void;
export declare function loadImageAsync(uri: string, options?: ImageLoadOptions): Promise<HTMLCanvasElement>;
/**
* Computes the size that bounds an image of the given dimensions to `maxWidth`/`maxHeight`,
* preserving the aspect ratio. Images that already fit within the bounds keep their size.
*/
export declare function boundedSize(width: number, height: number, maxWidth: number | undefined, maxHeight: number | undefined): {
width: number;
height: number;
};