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.
Properties
Section titled “Properties”convertHeic?
Section titled “convertHeic?”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.
convertSize?
Section titled “convertSize?”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).
keepOriginalDimensions?
Section titled “keepOriginalDimensions?”optional keepOriginalDimensions?: boolean;Defined in: packages/sdk/src/web/index.ts:209
Skip the resize pass (keep original dimensions). Default false.
maxHeight?
Section titled “maxHeight?”optional maxHeight?: number;Defined in: packages/sdk/src/web/index.ts:200
Default 3840 (LISTING_STANDARD_IMAGE_HEIGHT).
maxWidth?
Section titled “maxWidth?”optional maxWidth?: number;Defined in: packages/sdk/src/web/index.ts:198
Max edge in pixels. Default 3840 (LISTING_STANDARD_IMAGE_WIDTH).
mimeType?
Section titled “mimeType?”optional mimeType?: "image/jpeg" | "image/webp";Defined in: packages/sdk/src/web/index.ts:196
Output format. Default "image/webp" (DEFAULT_IMAGE_TARGET_FORMAT).
onProgress?
Section titled “onProgress?”optional onProgress?: (stage) => void;Defined in: packages/sdk/src/web/index.ts:216
Optional progress hook. Useful for UI status indicators.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
stage |
CompressStage |
Returns
Section titled “Returns”void
quality?
Section titled “quality?”optional quality?: number;Defined in: packages/sdk/src/web/index.ts:194
0..1. Default 0.80 (LISTING_STANDARD_IMAGE_QUALITY / 100).
strict?
Section titled “strict?”optional strict?: boolean;Defined in: packages/sdk/src/web/index.ts:207
compressorjs strict mode. Default true.