Table of Contents

Class ImagePatternTokens

Namespace
CivitaiSharp.Tools.Downloads.Patterns
Assembly
CivitaiSharp.Tools.dll

Defines valid tokens for image path patterns and extracts token values from images.

public static class ImagePatternTokens
Inheritance
ImagePatternTokens
Inherited Members

Properties

ValidTokens

The set of all valid token names for image path patterns.

public static FrozenSet<string> ValidTokens { get; }

Property Value

FrozenSet<string>

Methods

ExtractTokenValues(Image, string)

Extracts token values from an image for use in path pattern processing.

public static Dictionary<string, string> ExtractTokenValues(Image image, string extension)

Parameters

image Image

The image to extract values from.

extension string

The file extension to use (without leading dot).

Returns

Dictionary<string, string>

A dictionary mapping token names to their values.

InferExtension(Image)

Infers the file extension from an image URL or media type.

public static string InferExtension(Image image)

Parameters

image Image

The image to infer the extension from.

Returns

string

The inferred extension without a leading dot, or "png" as the default.