Static
Processes a media file (image or audio) using the optimal available engine.
Use compressImage or compressAudio instead. OmniCompressor.process() will be removed in v3.0. The new functions return a CompressResult with size metadata instead of a raw Blob.
OmniCompressor.process()
// v1.x (deprecated)const blob = await OmniCompressor.process(file, { type: 'image', format: 'webp' });// v2.0 (preferred)const { blob, ratio } = await compressImage(file, { format: 'webp' }); Copy
// v1.x (deprecated)const blob = await OmniCompressor.process(file, { type: 'image', format: 'webp' });// v2.0 (preferred)const { blob, ratio } = await compressImage(file, { format: 'webp' });
Configure the global logging level.
OmniCompressor.setLogLevel('debug'); // Show all logsOmniCompressor.setLogLevel('error'); // Only show errors Copy
OmniCompressor.setLogLevel('debug'); // Show all logsOmniCompressor.setLogLevel('error'); // Only show errors
Processes a media file (image or audio) using the optimal available engine.