Represents a dictionary of IPTC fields.
Namespace:
Aurigma.GraphicsMill.Codecs
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
public sealed class IptcDictionary : MetadataDictionary, ICloneable
All functionality of this class is implemented in base class MetadataDictionary. To put or get some IPTC field, you should use the Item[Object] property. Just pass ID of the IPTC field as an argument into this property. Refer IPTC specification for exact field ID values. Alternatively you can use static members Caption, Writer, Keyword, and others. Exact interpretations of these parameters can be found at IPTC specification. Currently specification 4.1 is supported.
IPTC tags consist of two numbers. For example, "2:25" means "Keywords". To be able to pass these numbers into Item[Object], you should pack them as follows: first byte stores the second number (25 in this example), the second byte stores the first number (2 in this example). Other two bytes are not used.
The code below demonstrates how to extract and display both EXIF and IPTC data.
using (var jpegReader = new JpegReader(@"Images\in.jpg")) { //Read metadata var exif = jpegReader.Exif; var iptc = jpegReader.Iptc; //Show EXIF tags if (exif != null) { Console.WriteLine("EXIF"); Console.WriteLine("---------------"); foreach (long key in exif.Keys) { Console.WriteLine("{0}: {1}, {2}", exif.GetKeyDescription(key), exif[key], exif.GetItemString(key)); } } //Show IPTC tags if (iptc != null) { Console.WriteLine("IPTC"); Console.WriteLine("---------------"); foreach (long key in iptc.Keys) { Console.WriteLine("{0}: {1}, {2}", iptc.GetKeyDescription(key), iptc[key], iptc.GetItemString(key)); } } }