This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

read iptc information

hello all people, i need read iptc information of the jpg file for example,
i have a graphicsmill.dll instaled in my computer.

this line write in the category the value "Nature"
iptc(Aurigma.GraphicsMill.Codecs.IptcDictionary.Category) = "Nature"

but, who i can to obtain the category or keyword or other iptc fields values?.

Please can you post any code?

thanks!

-------

Saludos a todos, necesito leer la información de un archivo jpg.
yo tengo instalado en mi máquina el graphicsmill.dll.

siguiendo un ejemplo puedo escribir información en algunos campos iptc, el codigo es el siguiente
iptc(Aurigma.GraphicsMill.Codecs.IptcDictionary.Category) = "Nature"


pero como puedo obtener el valor de los campos iptc.

si pueden postear algun codigo lesagradesco mucho

gracias !
Hello,

Here is the code sample which illustrates how to add tags to EXIF and IPTC metadata in JPEG:

using (Aurigma.GraphicsMill.Bitmap bitmap = new
    Aurigma.GraphicsMill.Bitmap("sample.jpg"))
{
	Aurigma.GraphicsMill.Codecs.JpegEncoderOptions encoderOptions = new 
                Aurigma.GraphicsMill.Codecs.JpegEncoderOptions(
                100, false);

	//EXIF
	Aurigma.GraphicsMill.Codecs.ExifDictionary exif = new 
                Aurigma.GraphicsMill.Codecs.ExifDictionary();
	exif[Aurigma.GraphicsMill.Codecs.ExifDictionary.Software] = 
                "Aurigma Graphics Mill";
	encoderOptions.Exif = exif;

	//IPTC
	Aurigma.GraphicsMill.Codecs.IptcDictionary iptc = new 
                Aurigma.GraphicsMill.Codecs.IptcDictionary();
	iptc[Aurigma.GraphicsMill.Codecs.IptcDictionary.Category] = "Nat";
	iptc[Aurigma.GraphicsMill.Codecs.IptcDictionary.CopyrightNotice] = 
               "Aurigma Inc.";
	iptc[Aurigma.GraphicsMill.Codecs.IptcDictionary.Keyword] = 
               "mountain";
	encoderOptions.Iptc = iptc;

	bitmap.Save("MetaData.jpg", encoderOptions);
}

Additional information about metadata using you can read in the Working with Metadata section of the online help.
thanks Dmitry,

but i dont write or add exif or iptc information, i need read only this information. You can help my?.

bye
Hello,

Here is the code sample which shows how to read tags value from EXIF:
string imageDesc = null;
string model = null;
string make = null;

using(Aurigma.GraphicsMill.Codecs.JpegReader reader = new 
    Aurigma.GraphicsMill.Codecs.JpegReader("sample.jpg"))
{
    Aurigma.GraphicsMill.Codecs.ExifDictionary exif = reader.Exif;

    if(exif.Contains(
        Aurigma.GraphicsMill.Codecs.ExifDictionary.ImageDescription))
        imageDesc = (string)exif[
            Aurigma.GraphicsMill.Codecs.ExifDictionary.ImageDescription];

    if(exif.Contains(
        Aurigma.GraphicsMill.Codecs.ExifDictionary.Model))
        model = (string)exif[
            Aurigma.GraphicsMill.Codecs.ExifDictionary.Model];

    if (exif.Contains(
        Aurigma.GraphicsMill.Codecs.ExifDictionary.Model))
        make = (string)exif[
            Aurigma.GraphicsMill.Codecs.ExifDictionary.Make];
}

You can read more information how to read/write tags from/to EXIF and IPTC in the Loading or Saving EXIF and IPTC Metadata article.
thanks Dmitry, it's the code.

thanks David M.