ImageTextEntry Class
An immutable textual metadata entry (PNG tEXt/zTXt/iTXt chunk, GIF comment extension, JPEG COM segment).
public sealed class ImageTextEntry : IEquatable<ImageTextEntry>Remarks
Whether an entry is representable depends on the output format (for example PNG keywords are limited to 1 to 79 Latin-1 characters, and GIF/JPEG only store comments). Entries are validated when they are serialized; unsupported entries follow the encoder's MetadataHandling policy. The compression of PNG text chunks is an encoding detail chosen by the encoder.
- Implements
Constructors
| Name | Description |
|---|---|
| ImageTextEntry(string, string, string?, string?) | Initializes a new instance of the ImageTextEntry class. |
ImageTextEntry(string, string, string?, string?)
ImageTextEntry.csInitializes a new instance of the ImageTextEntry class.
public ImageTextEntry(string keyword, string value, string? languageTag = null, string? translatedKeyword = null)Parameters
keywordstring- The keyword (for example
"Title","Author"orImageTextEntry.CommentKeyword). valuestring- The text.
languageTagstring?- The optional RFC 5646 language tag of
value. translatedKeywordstring?- The optional translation of
keywordintolanguageTag.
Exceptions
ArgumentExceptionkeywordis empty.ArgumentNullExceptionkeywordorvalueisnull.
Properties
| Name | Description |
|---|---|
| Keyword | Gets the keyword. |
| LanguageTag | Gets the RFC 5646 language tag of ImageTextEntry.Value, if any. |
| TranslatedKeyword | Gets the translated keyword, if any. |
| Value | Gets the text. |
Keyword
ImageTextEntry.csLanguageTag
ImageTextEntry.csGets the RFC 5646 language tag of ImageTextEntry.Value, if any.
public string? LanguageTag { get; }Property value
TranslatedKeyword
ImageTextEntry.csValue
ImageTextEntry.csMethods
| Name | Description |
|---|---|
| Equals(ImageTextEntry?) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Determines whether the specified object is equal to the current object. |
| GetHashCode() | Serves as the default hash function. |
| ToString() | Returns a string that represents the current object. |
Equals overloads
Equals(ImageTextEntry?)
ImageTextEntry.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(ImageTextEntry? other)Parameters
otherImageTextEntry?- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)
ImageTextEntry.csGetHashCode()
ImageTextEntry.csToString()
ImageTextEntry.csConstants
| Name | Description |
|---|---|
| CommentKeyword | The keyword used for comments (GIF comment extensions, JPEG COM segments, PNG "Comment" keyword). |
CommentKeyword
The keyword used for comments (GIF comment extensions, JPEG COM segments, PNG "Comment" keyword).
public const string CommentKeyword = "Comment"