Class IptcProfile
Represents an IPTC profile providing access to the collection of values.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Metadata.Profiles.Iptc
Assembly: SixLabors.ImageSharp.dll
Syntax
public sealed class IptcProfile : IDeepCloneable<IptcProfile>
Constructors
| Edit this page View SourceIptcProfile()
Initializes a new instance of the IptcProfile class.
Declaration
public IptcProfile()
IptcProfile(byte[]?)
Initializes a new instance of the IptcProfile class.
Declaration
public IptcProfile(byte[]? data)
Parameters
Type | Name | Description |
---|---|---|
byte[] | data | The byte array to read the iptc profile from. |
Properties
| Edit this page View SourceData
Gets the byte data of the IPTC profile.
Declaration
public byte[]? Data { get; }
Property Value
Type | Description |
---|---|
byte[] |
Values
Gets the values of this iptc profile.
Declaration
public IEnumerable<IptcValue> Values { get; }
Property Value
Type | Description |
---|---|
IEnumerable<IptcValue> |
Methods
| Edit this page View SourceDeepClone()
Creates a new IptcProfile that is a deep copy of the current instance.
Declaration
public IptcProfile DeepClone()
Returns
Type | Description |
---|---|
IptcProfile | The IptcProfile. |
GetValues(IptcTag)
Returns all values with the specified tag.
Declaration
public List<IptcValue> GetValues(IptcTag tag)
Parameters
Type | Name | Description |
---|---|---|
IptcTag | tag | The tag of the iptc value. |
Returns
Type | Description |
---|---|
List<IptcValue> | The values found with the specified tag. |
RemoveValue(IptcTag)
Removes all values with the specified tag.
Declaration
public bool RemoveValue(IptcTag tag)
Parameters
Type | Name | Description |
---|---|---|
IptcTag | tag | The tag of the iptc value to remove. |
Returns
Type | Description |
---|---|
bool | True when the value was found and removed. |
RemoveValue(IptcTag, string)
Removes values with the specified tag and value.
Declaration
public bool RemoveValue(IptcTag tag, string value)
Parameters
Type | Name | Description |
---|---|---|
IptcTag | tag | The tag of the iptc value to remove. |
string | value | The value of the iptc item to remove. |
Returns
Type | Description |
---|---|
bool | True when the value was found and removed. |
SetDateTimeValue(IptcTag, DateTimeOffset)
Makes sure the datetime is formatted according to the iptc specification.
Declaration
public void SetDateTimeValue(IptcTag tag, DateTimeOffset dateTimeOffset)
Parameters
Type | Name | Description |
---|---|---|
IptcTag | tag | The tag of the iptc value. |
DateTimeOffset | dateTimeOffset | The datetime. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Iptc tag is not a time or date type. |
SetEncoding(Encoding)
Changes the encoding for all the values.
Declaration
public void SetEncoding(Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
Encoding | encoding | The encoding to use when storing the bytes. |
SetValue(IptcTag, string, bool)
Sets the value of the specified tag.
Declaration
public void SetValue(IptcTag tag, string value, bool strict = true)
Parameters
Type | Name | Description |
---|---|---|
IptcTag | tag | The tag of the iptc value. |
string | value | The value. |
bool | strict | 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.
Declaration
public void SetValue(IptcTag tag, Encoding encoding, string value, bool strict = true)
Parameters
Type | Name | Description |
---|---|---|
IptcTag | tag | The tag of the iptc value. |
Encoding | encoding | The encoding to use when storing the bytes. |
string | value | The value. |
bool | strict | Indicates if length restrictions from the specification should be followed strictly. Defaults to true. |
UpdateData()
Updates the data of the profile.
Declaration
public void UpdateData()