compressImage
function compressImage(file, opts?): Promise<CompressResult>;Defined in: packages/sdk/src/web/index.ts:249
Compress a single image. Browser-only; in Node/Bun this is a no-op that returns the input unchanged (with a warning).
Dynamically imports @aquienpz/asset-compressor-web so apps that never
call compress: true don’t pay the compressorjs + heic2any bundle cost.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
file |
File | Blob |
opts |
CompressOptions |
Returns
Section titled “Returns”Promise<CompressResult>