Skip to content

BrowserFormatSelector ​

Namespace: MJCZone.MediaMatic.AspNetCore.Transformations

Assembly: MJCZone.MediaMatic.AspNetCore

Summary ​

Selects optimal image format based on browser capabilities.

static public

Contents ​

Methods (5)

Methods ​

SelectOptimalFormat ​

Selects the optimal image format based on browser capabilities.

csharp
ImageFormat? SelectOptimalFormat(
    string userAgent,
    string acceptHeader,
    ImageFormat originalFormat)

Parameters ​

  • userAgent (string) - User-Agent header from the HTTP request.
  • acceptHeader (string) - Accept header from the HTTP request.
  • originalFormat (ImageFormat) - The original image format (fallback).

Returns ​

Type: ImageFormat?

The optimal image format to serve.

GetType ​

csharp
GetType()

ToString ​

csharp
ToString()

Equals ​

csharp
Equals()

GetHashCode ​

csharp
GetHashCode()