Skip to content

CompressOptions

type CompressOptions = {
convertHeic?: boolean;
convertSize?: number;
keepOriginalDimensions?: boolean;
maxHeight?: number;
maxWidth?: number;
mimeType?: "image/jpeg" | "image/webp";
onProgress?: (stage) => void;
quality?: number;
strict?: boolean;
};

Defined in: packages/sdk/src/web/index.ts:192

Subset of compressorjs options exposed by the SDK. Matches the webapp’s DEFAULT_COMPRESSION_OPTIONS shape from the realtyone-cr production back-office uploader.

optional convertHeic?: boolean;

Defined in: packages/sdk/src/web/index.ts:214

Convert HEIC/HEIF inputs to JPEG via heic2any first. Default true. Has no effect on non-HEIC inputs.


optional convertSize?: number;

Defined in: packages/sdk/src/web/index.ts:205

compressorjs convertSize: PNG > this byte count auto-converts to JPEG before the quality pass. Default 5 MB (5 * 1024 * 1024).


optional keepOriginalDimensions?: boolean;

Defined in: packages/sdk/src/web/index.ts:209

Skip the resize pass (keep original dimensions). Default false.


optional maxHeight?: number;

Defined in: packages/sdk/src/web/index.ts:200

Default 3840 (LISTING_STANDARD_IMAGE_HEIGHT).


optional maxWidth?: number;

Defined in: packages/sdk/src/web/index.ts:198

Max edge in pixels. Default 3840 (LISTING_STANDARD_IMAGE_WIDTH).


optional mimeType?: "image/jpeg" | "image/webp";

Defined in: packages/sdk/src/web/index.ts:196

Output format. Default "image/webp" (DEFAULT_IMAGE_TARGET_FORMAT).


optional onProgress?: (stage) => void;

Defined in: packages/sdk/src/web/index.ts:216

Optional progress hook. Useful for UI status indicators.

Parameter Type
stage CompressStage

void


optional quality?: number;

Defined in: packages/sdk/src/web/index.ts:194

0..1. Default 0.80 (LISTING_STANDARD_IMAGE_QUALITY / 100).


optional strict?: boolean;

Defined in: packages/sdk/src/web/index.ts:207

compressorjs strict mode. Default true.