Table of Contents

Class IptcEntry

Namespace
Egami.Metadata
Assembly
Egami.dll

One IPTC-IIM dataset as stored: its key and its bytes.

public sealed class IptcEntry
Inheritance
IptcEntry
Inherited Members

Examples

using Raster photo = Raster.Load("sideways.jpg");
IptcData iptc = photo.Metadata.Iptc ?? new IptcData();
iptc.Headline = "Harbour at dawn";
iptc.Keywords = [.. iptc.Keywords, "harbour", "Bergen"];

// Any dataset by its key; Add appends to the repeatable ones.
iptc.Set(IptcKey.City, "Bergen");

// Text that is not ASCII sets the coded character set (1:90) to UTF-8, so other programs read it right.
iptc.Caption = "Fishing boats at Bryggen, Bergen — first light";
foreach (IptcEntry entry in iptc.Entries)
{
    Console.WriteLine($"{entry.Key} {entry.AsString()}");
}

// JPEG saves it in its Photoshop resource block (APP13), with the digest Photoshop and Lightroom check.
photo.Metadata.Iptc = iptc;
photo.Save("captioned.jpg");

Properties

Key

Gets the record and dataset.

public IptcKey Key { get; }

Property Value

IptcKey

RawValue

Gets the value's bytes as stored.

public ReadOnlyMemory<byte> RawValue { get; }

Property Value

ReadOnlyMemory<byte>

Methods

AsString()

Returns the value as text: UTF-8 when the block's coded character set (1:90) says so, otherwise UTF-8 when the bytes are valid UTF-8 and Latin-1 when they are not, the rule AsString() uses.

public string AsString()

Returns

string

The text.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.