Tracker Extract Library Reference Manual: IPTC

## IPTC IPTC — Information Interchange Model (IIM) / International Press Telecommunications Council (IPTC) |

## Stability Level

Stable, unless otherwise indicated

## Synopsis

    #include <libtracker-extract/tracker-extract.h>

                        TrackerIptcData;
    TrackerIptcData *   tracker_iptc_new                    (const guchar *buffer,
                                                             gsize len,
                                                             const gchar *uri);
    void                tracker_iptc_free                   (TrackerIptcData *data);
    gboolean            tracker_iptc_read                   (const unsigned char *buffer,
                                                             size_t len,
                                                             const gchar *uri,
                                                             TrackerIptcData *data);

## Description

The Information Interchange Model (IIM) is a file structure and set of metadata attributes that can be applied to text, images and other media types. It was developed in the early 1990s by the International Press Telecommunications Council (IPTC) to expedite the international exchange of news among newspapers and news agencies.

The full IIM specification includes a complex data structure and a set of metadata definitions.

Although IIM was intended for use with all types of news items — including simple text articles — a subset found broad worldwide acceptance as the standard embedded metadata used by news and commercial photographers. Information such as the name of the photographer, copyright information and the caption or other description can be embedded either manually or automatically.

IIM metadata embedded in images are often referred to as "IPTC headers," and can be easily encoded and decoded by most popular photo editing software.

The Extensible Metadata Platform (XMP) has largely superseded IIM's file structure, but the IIM image attributes are defined in the IPTC Core schema for XMP and most image manipulation programs keep the XMP and non-XMP IPTC attributes synchronized.

This API is provided to remove code duplication between extractors using these standards.

## Details

### TrackerIptcData

    typedef struct {
    	gchar *keywords;
    	gchar *date_created;
    	gchar *byline;
    	gchar *credit;
    	gchar *copyright_notice;
    	gchar *image_orientation;
    	gchar *byline_title;
    	gchar *city;
    	gchar *state;
    	gchar *sublocation;
    	gchar *country_name;
    	gchar *contact;
    } TrackerIptcData;

Structure defining IPTC data.

gchar *`keywords`; | Keywords.
gchar *`date_created`; | Date created.
gchar *`byline`; | Byline.
gchar *`credit`; | Credits.
gchar *`copyright_notice`; | Copyright.
gchar *`image_orientation`; | Image orientation.
gchar *`byline_title`; | Byline title.
gchar *`city`; | City.
gchar *`state`; | State.
gchar *`sublocation`; | Sublocation.
gchar *`country_name`; | Country.
gchar *`contact`; | Contact info.

### tracker_iptc_new ()

    TrackerIptcData *   tracker_iptc_new                    (const guchar *buffer,
                                                             gsize len,
                                                             const gchar *uri);

This function takes `len` bytes of `buffer` and runs it through the IPTC library.

`buffer` : | a chunk of data with iptc data in it.
`len` : | the size of `buffer`.
`uri` : | the URI this is related to.
Returns : | a newly allocated TrackerIptcData struct if IPTC data was found, `NULL` otherwise. Free the returned struct with `tracker_iptc_free()`.

Since 0.10

### tracker_iptc_free ()

    void                tracker_iptc_free                   (TrackerIptcData *data);

Frees `data` and all TrackerIptcData members. `NULL` will produce a a warning.

`data` : | a TrackerIptcData

Since 0.10

### tracker_iptc_read ()

    gboolean            tracker_iptc_read                   (const unsigned char *buffer,
                                                             size_t len,
                                                             const gchar *uri,
                                                             TrackerIptcData *data);

### Warning

`tracker_iptc_read` is deprecated and should not be used in newly-written code. 0.9. Use `tracker_iptc_new()` instead.

This function takes `len` bytes of `buffer` and runs it through the IPTC library. The result is that `data` is populated with the IPTC data found in `uri`.

`buffer` : | a chunk of data with iptc data in it.
`len` : | the size of `buffer`.
`uri` : | the URI this is related to.
`data` : | a pointer to a TrackerIptcData struture to populate.
Returns : | `TRUE` if the `data` was populated successfully, otherwise `FALSE` is returned.

Since 0.8