omni-compress - v2.3.1
    Preparing search index...

    Class OmniCompressor

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Processes a media file (image or audio) using the optimal available engine.

      Parameters

      Returns Promise<Blob>

      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.

      // 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.

      Parameters

      • level: "debug" | "info" | "warn" | "error"

      Returns void

      OmniCompressor.setLogLevel('debug'); // Show all logs
      OmniCompressor.setLogLevel('error'); // Only show errors