Class ImageMetadata
- Namespace
- SixLabors.ImageSharp.Metadata
- Assembly
- SixLabors.ImageSharp.dll
Encapsulates the metadata of an image.
public sealed class ImageMetadata : IDeepCloneable<ImageMetadata>
- Inheritance
-
ImageMetadata
- Implements
- Inherited Members
- Extension Methods
Constructors
ImageMetadata()
Initializes a new instance of the ImageMetadata class.
public ImageMetadata()
Fields
DefaultHorizontalResolution
The default horizontal resolution value (dots per inch) in x direction.
public const double DefaultHorizontalResolution = 96
Field Value
DefaultPixelResolutionUnits
The default pixel resolution units.
public const PixelResolutionUnit DefaultPixelResolutionUnits = PixelsPerInch
Field Value
DefaultVerticalResolution
The default vertical resolution value (dots per inch) in y direction.
public const double DefaultVerticalResolution = 96
Field Value
Properties
CicpProfile
Gets or sets the CICP profile.
public CicpProfile? CicpProfile { get; set; }
Property Value
DecodedImageFormat
Gets the original format, if any, the image was decode from.
public IImageFormat? DecodedImageFormat { get; }
Property Value
ExifProfile
Gets or sets the Exif profile.
public ExifProfile? ExifProfile { get; set; }
Property Value
HorizontalResolution
Gets or sets the resolution of the image in x- direction. It is defined as the number of dots per ResolutionUnits and should be an positive value.
public double HorizontalResolution { get; set; }
Property Value
- double
The density of the image in x- direction.
IccProfile
Gets or sets the ICC profile.
public IccProfile? IccProfile { get; set; }
Property Value
IptcProfile
Gets or sets the IPTC profile.
public IptcProfile? IptcProfile { get; set; }
Property Value
ResolutionUnits
Gets or sets unit of measure used when reporting resolution.
Value | Unit |
---|---|
AspectRatio (00) | No units; width:height pixel aspect ratio = Ydensity:Xdensity |
PixelsPerInch (01) | Pixels per inch (2.54 cm) |
PixelsPerCentimeter (02) | Pixels per centimeter |
PixelsPerMeter (03) | Pixels per meter (100 cm) |
public PixelResolutionUnit ResolutionUnits { get; set; }
Property Value
VerticalResolution
Gets or sets the resolution of the image in y- direction. It is defined as the number of dots per ResolutionUnits and should be an positive value.
public double VerticalResolution { get; set; }
Property Value
- double
The density of the image in y- direction.
XmpProfile
Gets or sets the XMP profile.
public XmpProfile? XmpProfile { get; set; }
Property Value
Methods
DeepClone()
public ImageMetadata DeepClone()
Returns
GetFormatMetadata<TFormatMetadata>(IImageFormat<TFormatMetadata>)
Gets the metadata value associated with the specified key.
public TFormatMetadata GetFormatMetadata<TFormatMetadata>(IImageFormat<TFormatMetadata> key) where TFormatMetadata : class, IDeepCloneable
Parameters
key
IImageFormat<TFormatMetadata>The key of the value to get.
Returns
- TFormatMetadata
The
TFormatMetadata
.
Type Parameters
TFormatMetadata
The type of metadata.
TryGetFormatMetadata<TFormatMetadata>(IImageFormat<TFormatMetadata>, out TFormatMetadata?)
Gets the metadata value associated with the specified key.
public bool TryGetFormatMetadata<TFormatMetadata>(IImageFormat<TFormatMetadata> key, out TFormatMetadata? metadata) where TFormatMetadata : class, IDeepCloneable
Parameters
key
IImageFormat<TFormatMetadata>The key of the value to get.
metadata
TFormatMetadataWhen this method returns, contains the metadata associated with the specified key, if the key is found; otherwise, the default value for the type of the metadata parameter. This parameter is passed uninitialized.
Returns
Type Parameters
TFormatMetadata
The type of format metadata.