Table of Contents

Class ImageFormats

Namespace
LMKit.Media.Image
Assembly
LM-Kit.NET.dll

Public registry of the image formats the toolkit knows: their file extensions and MIME types, backed by the toolkit's single internal format table. Use it to build hosts and clients that stay in lockstep with the toolkit as formats are added, instead of hardcoding extension or MIME lists that drift.

public static class ImageFormats
Inheritance
ImageFormats
Inherited Members

Examples

using LMKit.Media.Image;

string mime = ImageFormats.GetMimeType(".heif");        // "image/heic"
string extension = ImageFormats.GetExtension("image/tiff"); // ".tif"
bool accepted = ImageFormats.SupportedExtensions.Contains(".avif"); // true

Remarks

SupportedExtensions is the image slice of SupportedFileExtensions: every extension of every format the imaging runtime decodes. The lookup methods also answer for formats the runtime only identifies without decoding (for example DDS or QOI), since labeling a file is useful even when its pixels are never read.

Properties

SupportedExtensions

Gets every file extension of every image format the imaging runtime decodes, in canonical form: lowercase, dot-prefixed, sorted, no duplicates (for example ".png", ".jpg", ".heic").

Methods

GetExtension(string)

Resolves a MIME type to the canonical file extension of the image format it identifies.

GetMimeType(string)

Resolves a file extension to the MIME type of the image format it belongs to.

Share