Skip to content
@drupflare/spool v1.0.0 GitHub
    Preparing search index...

    Function imageVariant

    • The WebP quality and width ceiling for one request, from its headers. Save-Data: on picks quality.saveData, else an ECT of slow-2g, 2g or 3g picks quality.slow, else quality.default. The width is Sec-CH-Width, else Sec-CH-Viewport-Width times Sec-CH-DPR rounded up, else width.fallback; a value that is not a positive number of at most 16384 is ignored.

      Parameters

      • headers: Headers
      • options: Pick<ImageOptions, "quality" | "width"> = {}

      Returns { quality: number; width?: number }