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
databyte[]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
Methods
DeepClone()
public IptcProfile DeepClone()
Returns
GetValues(IptcTag)
Returns all values with the specified tag.
public List<IptcValue> GetValues(IptcTag tag)
Parameters
tagIptcTagThe tag of the iptc value.
Returns
RemoveValue(IptcTag)
Removes all values with the specified tag.
public bool RemoveValue(IptcTag tag)
Parameters
tagIptcTagThe 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
Returns
- bool
True when the value was found and removed.
SetDateTimeValue(IptcTag, DateTimeOffset)
Makes sure the datetime is formatted according to the iptc specification.
public void SetDateTimeValue(IptcTag tag, DateTimeOffset dateTimeOffset)
Parameters
tagIptcTagThe tag of the iptc value.
dateTimeOffsetDateTimeOffsetThe 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
encodingEncodingThe 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
tagIptcTagThe tag of the iptc value.
valuestringThe value.
strictboolIndicates 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
tagIptcTagThe tag of the iptc value.
encodingEncodingThe encoding to use when storing the bytes.
valuestringThe value.
strictboolIndicates if length restrictions from the specification should be followed strictly. Defaults to true.
UpdateData()
Updates the data of the profile.
public void UpdateData()