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
| Improve this Doc 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
| Improve this Doc 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
| Improve this Doc View SourceDeepClone()
Creates a new T
that is a deep copy of the current instance.
Declaration
public IptcProfile DeepClone()
Returns
Type | Description |
---|---|
IptcProfile | The |
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 |
---|---|
Boolean | 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 |
---|---|
Boolean | 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. |
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, Boolean)
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. |
Boolean | strict | Indicates if length restrictions from the specification should be followed strictly. Defaults to true. |
SetValue(IptcTag, Encoding, String, Boolean)
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. |
Boolean | 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()