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, from which the image was decoded.
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
CloneFormatMetadata<TFormatMetadata>(IImageFormat<TFormatMetadata>)
Creates a new instance the metadata value associated with the specified key. The instance is created from a clone generated via GetFormatMetadata<TFormatMetadata>(IImageFormat<TFormatMetadata>).
public TFormatMetadata CloneFormatMetadata<TFormatMetadata>(IImageFormat<TFormatMetadata> key) where TFormatMetadata : class, IFormatMetadata<TFormatMetadata>
Parameters
keyIImageFormat<TFormatMetadata>The key of the value to get.
Returns
- TFormatMetadata
The
TFormatMetadata.
Type Parameters
TFormatMetadataThe type of metadata.
DeepClone()
Creates a new ImageMetadata that is a deep copy of the current instance.
public ImageMetadata DeepClone()
Returns
GetFormatMetadata<TFormatMetadata>(IImageFormat<TFormatMetadata>)
Gets the metadata value associated with the specified key.
If none is found, an instance is created either by conversion from the decoded image format metadata
or the requested format default constructor.
This instance will be added to the metadata for future requests.
public TFormatMetadata GetFormatMetadata<TFormatMetadata>(IImageFormat<TFormatMetadata> key) where TFormatMetadata : class, IFormatMetadata<TFormatMetadata>
Parameters
keyIImageFormat<TFormatMetadata>The key of the value to get.
Returns
- TFormatMetadata
The
TFormatMetadata.
Type Parameters
TFormatMetadataThe type of metadata.