Class ImageMetadata
Encapsulates the metadata of an image.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Metadata
Assembly: SixLabors.ImageSharp.dll
Syntax
public sealed class ImageMetadata : IDeepCloneable<ImageMetadata>
Constructors
| Edit this page View SourceImageMetadata()
Initializes a new instance of the ImageMetadata class.
Declaration
public ImageMetadata()
Fields
| Edit this page View SourceDefaultHorizontalResolution
The default horizontal resolution value (dots per inch) in x direction.
Declaration
public const double DefaultHorizontalResolution = 96
Field Value
Type | Description |
---|---|
double |
DefaultPixelResolutionUnits
The default pixel resolution units.
Declaration
public const PixelResolutionUnit DefaultPixelResolutionUnits = PixelsPerInch
Field Value
Type | Description |
---|---|
PixelResolutionUnit |
DefaultVerticalResolution
The default vertical resolution value (dots per inch) in y direction.
Declaration
public const double DefaultVerticalResolution = 96
Field Value
Type | Description |
---|---|
double |
Properties
| Edit this page View SourceCicpProfile
Gets or sets the CICP profile.
Declaration
public CicpProfile? CicpProfile { get; set; }
Property Value
Type | Description |
---|---|
CicpProfile |
DecodedImageFormat
Gets the original format, if any, the image was decode from.
Declaration
public IImageFormat? DecodedImageFormat { get; }
Property Value
Type | Description |
---|---|
IImageFormat |
ExifProfile
Gets or sets the Exif profile.
Declaration
public ExifProfile? ExifProfile { get; set; }
Property Value
Type | Description |
---|---|
ExifProfile |
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.
Declaration
public double HorizontalResolution { get; set; }
Property Value
Type | Description |
---|---|
double | The density of the image in x- direction. |
IccProfile
Gets or sets the ICC profile.
Declaration
public IccProfile? IccProfile { get; set; }
Property Value
Type | Description |
---|---|
IccProfile |
IptcProfile
Gets or sets the IPTC profile.
Declaration
public IptcProfile? IptcProfile { get; set; }
Property Value
Type | Description |
---|---|
IptcProfile |
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) |
Declaration
public PixelResolutionUnit ResolutionUnits { get; set; }
Property Value
Type | Description |
---|---|
PixelResolutionUnit |
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.
Declaration
public double VerticalResolution { get; set; }
Property Value
Type | Description |
---|---|
double | The density of the image in y- direction. |
XmpProfile
Gets or sets the XMP profile.
Declaration
public XmpProfile? XmpProfile { get; set; }
Property Value
Type | Description |
---|---|
XmpProfile |
Methods
| Edit this page View SourceDeepClone()
Creates a new ImageMetadata that is a deep copy of the current instance.
Declaration
public ImageMetadata DeepClone()
Returns
Type | Description |
---|---|
ImageMetadata | The ImageMetadata. |
GetFormatMetadata<TFormatMetadata>(IImageFormat<TFormatMetadata>)
Gets the metadata value associated with the specified key.
Declaration
public TFormatMetadata GetFormatMetadata<TFormatMetadata>(IImageFormat<TFormatMetadata> key) where TFormatMetadata : class, IDeepCloneable
Parameters
Type | Name | Description |
---|---|---|
IImageFormat<TFormatMetadata> | key | The key of the value to get. |
Returns
Type | Description |
---|---|
TFormatMetadata | The |
Type Parameters
Name | Description |
---|---|
TFormatMetadata | The type of metadata. |
TryGetFormatMetadata<TFormatMetadata>(IImageFormat<TFormatMetadata>, out TFormatMetadata?)
Gets the metadata value associated with the specified key.
Declaration
public bool TryGetFormatMetadata<TFormatMetadata>(IImageFormat<TFormatMetadata> key, out TFormatMetadata? metadata) where TFormatMetadata : class, IDeepCloneable
Parameters
Type | Name | Description |
---|---|---|
IImageFormat<TFormatMetadata> | key | The key of the value to get. |
TFormatMetadata | metadata | When 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 | Description |
---|---|
bool | true if the frame metadata exists for the specified key; otherwise, false. |
Type Parameters
Name | Description |
---|---|
TFormatMetadata | The type of format metadata. |