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
lastWriteTimeUtcDateTimeThe date and time in coordinated universal time (UTC) since the source file was last modified.
contentLengthlongThe 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
lastWriteTimeUtcDateTimeThe date and time in coordinated universal time (UTC) since the source file was last modified.
cacheControlMaxAgeTimeSpanThe maximum amount of time a resource will be considered fresh.
contentLengthlongThe 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
ContentLength
Gets the length of the image in bytes.
public long ContentLength { get; }
Property Value
LastWriteTimeUtc
Gets the date and time in coordinated universal time (UTC) since the source file was last modified.
public DateTime LastWriteTimeUtc { get; }
Property Value
Methods
Equals(ImageMetadata)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ImageMetadata other)
Parameters
otherImageMetadataAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
leftImageMetadataThe ImageMetadata on the left side of the operand.
rightImageMetadataThe ImageMetadata on the right side of the operand.
Returns
- bool
True if the current left is equal to the
rightparameter; otherwise, false.
operator !=(in ImageMetadata, in ImageMetadata)
Compares two ImageMetadata objects for inequality.
public static bool operator !=(in ImageMetadata left, in ImageMetadata right)
Parameters
leftImageMetadataThe ImageMetadata on the left side of the operand.
rightImageMetadataThe ImageMetadata on the right side of the operand.
Returns
- bool
True if the current left is unequal to the
rightparameter; otherwise, false.