Table of Contents

Class IptcProfile

Namespace
SixLabors.ImageSharp.Metadata.Profiles.Iptc
Assembly
SixLabors.ImageSharp.dll

Represents an IPTC profile providing access to the collection of values.

public sealed class IptcProfile : IDeepCloneable<IptcProfile>
Inheritance
IptcProfile
Implements
Inherited Members

Constructors

IptcProfile()

Initializes a new instance of the IptcProfile class.

public IptcProfile()

IptcProfile(byte[]?)

Initializes a new instance of the IptcProfile class.

public IptcProfile(byte[]? data)

Parameters

data byte[]

The byte array to read the iptc profile from.

Properties

Data

Gets the byte data of the IPTC profile.

public byte[]? Data { get; }

Property Value

byte[]

Values

Gets the values of this iptc profile.

public IEnumerable<IptcValue> Values { get; }

Property Value

IEnumerable<IptcValue>

Methods

DeepClone()

public IptcProfile DeepClone()

Returns

IptcProfile

GetValues(IptcTag)

Returns all values with the specified tag.

public List<IptcValue> GetValues(IptcTag tag)

Parameters

tag IptcTag

The tag of the iptc value.

Returns

List<IptcValue>

The values found with the specified tag.

RemoveValue(IptcTag)

Removes all values with the specified tag.

public bool RemoveValue(IptcTag tag)

Parameters

tag IptcTag

The tag of the iptc value to remove.

Returns

bool

True when the value was found and removed.

RemoveValue(IptcTag, string)

Removes values with the specified tag and value.

public bool RemoveValue(IptcTag tag, string value)

Parameters

tag IptcTag

The tag of the iptc value to remove.

value string

The value of the iptc item to remove.

Returns

bool

True when the value was found and removed.

SetDateTimeValue(IptcTag, DateTimeOffset)

Makes sure the datetime is formatted according to the iptc specification. A date will be formatted as CCYYMMDD, e.g. "19890317" for 17 March 1989. A time value will be formatted as HHMMSS±HHMM, e.g. "090000+0200" for 9 o'clock Berlin time, two hours ahead of UTC.

public void SetDateTimeValue(IptcTag tag, DateTimeOffset dateTimeOffset)

Parameters

tag IptcTag

The tag of the iptc value.

dateTimeOffset DateTimeOffset

The datetime.

Exceptions

ArgumentException

Iptc tag is not a time or date type.

SetEncoding(Encoding)

Changes the encoding for all the values.

public void SetEncoding(Encoding encoding)

Parameters

encoding Encoding

The encoding to use when storing the bytes.

SetValue(IptcTag, string, bool)

Sets the value of the specified tag.

public void SetValue(IptcTag tag, string value, bool strict = true)

Parameters

tag IptcTag

The tag of the iptc value.

value string

The value.

strict bool

Indicates if length restrictions from the specification should be followed strictly. Defaults to true.

SetValue(IptcTag, Encoding, string, bool)

Sets the value for the specified tag.

public void SetValue(IptcTag tag, Encoding encoding, string value, bool strict = true)

Parameters

tag IptcTag

The tag of the iptc value.

encoding Encoding

The encoding to use when storing the bytes.

value string

The value.

strict bool

Indicates if length restrictions from the specification should be followed strictly. Defaults to true.

UpdateData()

Updates the data of the profile.

public void UpdateData()