Struct ImageMetadata
Represents the metadata associated with an image file.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Web
Assembly: SixLabors.ImageSharp.Web.dll
Syntax
public readonly struct ImageMetadata : IEquatable<ImageMetadata>
Constructors
| Edit this page View SourceImageMetadata(DateTime, long)
Initializes a new instance of the ImageMetadata struct.
Declaration
public ImageMetadata(DateTime lastWriteTimeUtc, long contentLength)
Parameters
Type | Name | Description |
---|---|---|
DateTime | lastWriteTimeUtc | The date and time in coordinated universal time (UTC) since the source file was last modified. |
long | contentLength | The length of the image in bytes. |
ImageMetadata(DateTime, TimeSpan, long)
Initializes a new instance of the ImageMetadata struct.
Declaration
public ImageMetadata(DateTime lastWriteTimeUtc, TimeSpan cacheControlMaxAge, long contentLength)
Parameters
Type | Name | Description |
---|---|---|
DateTime | lastWriteTimeUtc | The date and time in coordinated universal time (UTC) since the source file was last modified. |
TimeSpan | cacheControlMaxAge | The maximum amount of time a resource will be considered fresh. |
long | contentLength | The length of the image in bytes. |
Properties
| Edit this page View SourceCacheControlMaxAge
Gets the maximum amount of time a resource will be considered fresh.
Declaration
public TimeSpan CacheControlMaxAge { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
ContentLength
Gets the length of the image in bytes.
Declaration
public long ContentLength { get; }
Property Value
Type | Description |
---|---|
long |
LastWriteTimeUtc
Gets the date and time in coordinated universal time (UTC) since the source file was last modified.
Declaration
public DateTime LastWriteTimeUtc { get; }
Property Value
Type | Description |
---|---|
DateTime |
Methods
| Edit this page View SourceEquals(ImageMetadata)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(ImageMetadata other)
Parameters
Type | Name | Description |
---|---|---|
ImageMetadata | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
bool | true if |
Overrides
| Edit this page View SourceGetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
| Edit this page View SourceToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The fully qualified type name. |
Overrides
Operators
| Edit this page View Sourceoperator ==(in ImageMetadata, in ImageMetadata)
Compares two ImageMetadata objects for equality.
Declaration
public static bool operator ==(in ImageMetadata left, in ImageMetadata right)
Parameters
Type | Name | Description |
---|---|---|
ImageMetadata | left | The ImageMetadata on the left side of the operand. |
ImageMetadata | right | The ImageMetadata on the right side of the operand. |
Returns
Type | Description |
---|---|
bool | True if the current left is equal to the |
operator !=(in ImageMetadata, in ImageMetadata)
Compares two ImageMetadata objects for inequality.
Declaration
public static bool operator !=(in ImageMetadata left, in ImageMetadata right)
Parameters
Type | Name | Description |
---|---|---|
ImageMetadata | left | The ImageMetadata on the left side of the operand. |
ImageMetadata | right | The ImageMetadata on the right side of the operand. |
Returns
Type | Description |
---|---|
bool | True if the current left is unequal to the |