Table of Contents

Struct ImageMetadata

Namespace
SixLabors.ImageSharp.Web
Assembly
SixLabors.ImageSharp.Web.dll

Represents the metadata associated with an image file.

public readonly struct ImageMetadata : IEquatable<ImageMetadata>
Implements
Inherited Members

Constructors

ImageMetadata(DateTime, long)

Initializes a new instance of the ImageMetadata struct.

public ImageMetadata(DateTime lastWriteTimeUtc, long contentLength)

Parameters

lastWriteTimeUtc DateTime

The date and time in coordinated universal time (UTC) since the source file was last modified.

contentLength long

The length of the image in bytes.

ImageMetadata(DateTime, TimeSpan, long)

Initializes a new instance of the ImageMetadata struct.

public ImageMetadata(DateTime lastWriteTimeUtc, TimeSpan cacheControlMaxAge, long contentLength)

Parameters

lastWriteTimeUtc DateTime

The date and time in coordinated universal time (UTC) since the source file was last modified.

cacheControlMaxAge TimeSpan

The maximum amount of time a resource will be considered fresh.

contentLength long

The length of the image in bytes.

Properties

CacheControlMaxAge

Gets the maximum amount of time a resource will be considered fresh.

public TimeSpan CacheControlMaxAge { get; }

Property Value

TimeSpan

ContentLength

Gets the length of the image in bytes.

public long ContentLength { get; }

Property Value

long

LastWriteTimeUtc

Gets the date and time in coordinated universal time (UTC) since the source file was last modified.

public DateTime LastWriteTimeUtc { get; }

Property Value

DateTime

Methods

Equals(ImageMetadata)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ImageMetadata other)

Parameters

other ImageMetadata

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(in ImageMetadata, in ImageMetadata)

Compares two ImageMetadata objects for equality.

public static bool operator ==(in ImageMetadata left, in ImageMetadata right)

Parameters

left ImageMetadata

The ImageMetadata on the left side of the operand.

right ImageMetadata

The ImageMetadata on the right side of the operand.

Returns

bool

True if the current left is equal to the right parameter; otherwise, false.

operator !=(in ImageMetadata, in ImageMetadata)

Compares two ImageMetadata objects for inequality.

public static bool operator !=(in ImageMetadata left, in ImageMetadata right)

Parameters

left ImageMetadata

The ImageMetadata on the left side of the operand.

right ImageMetadata

The ImageMetadata on the right side of the operand.

Returns

bool

True if the current left is unequal to the right parameter; otherwise, false.