Functions related to EXIF metadata: gexiv2 Reference Manual

## Functions related to EXIF metadata Functions related to EXIF metadata — Functionality specific to the EXIF familiy of metadata information |

## Functions

gboolean | gexiv2_metadata_is_exif_tag ()
gboolean | gexiv2_metadata_get_supports_exif ()
gboolean | gexiv2_metadata_has_exif ()
gchar ** | gexiv2_metadata_get_exif_tags ()
void | gexiv2_metadata_clear_exif ()
gboolean | gexiv2_metadata_try_get_exif_tag_rational ()
gboolean | gexiv2_metadata_try_set_exif_tag_rational ()
gboolean | gexiv2_metadata_get_exif_thumbnail ()
GBytes * | gexiv2_metadata_get_exif_data ()
gboolean | gexiv2_metadata_set_exif_thumbnail_from_file ()
void | gexiv2_metadata_try_set_exif_thumbnail_from_buffer ()
void | gexiv2_metadata_try_erase_exif_thumbnail ()
gboolean | gexiv2_metadata_get_exif_tag_rational ()
gboolean | gexiv2_metadata_set_exif_tag_rational ()
void | gexiv2_metadata_set_exif_thumbnail_from_buffer ()
void | gexiv2_metadata_erase_exif_thumbnail ()

## Includes

    #include <gexiv2/gexiv2.h>

## Description

While being part of GExiv2Metadata, these functions are dealing with specific aspects of EXIF

## Functions

### gexiv2_metadata_is_exif_tag ()

    gboolean
    gexiv2_metadata_is_exif_tag (const gchar *tag);

The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html

#### Parameters

tag | An Exiv2 tag |

#### Returns

TRUE if the Exiv2 tag is for the EXIF domain.

### gexiv2_metadata_get_supports_exif ()

    gboolean
    gexiv2_metadata_get_supports_exif (GExiv2Metadata *self);

Query `self` whether it supports writing EXIF metadata.

#### Parameters

self | An instance of GExiv2Metadata |

#### Returns

`TRUE` if the loaded image type supports writing EXIF metadata.

### gexiv2_metadata_has_exif ()

    gboolean
    gexiv2_metadata_has_exif (GExiv2Metadata *self);

#### Parameters

self | An instance of GExiv2Metadata |

#### Returns

TRUE if EXIF metadata is present in the loaded image

### gexiv2_metadata_get_exif_tags ()

    gchar **
    gexiv2_metadata_get_exif_tags (GExiv2Metadata *self);

Query `self` for a list of available EXIF tags

#### Parameters

self | An instance of GExiv2Metadata |

#### Returns

A unique list of the available EXIF tags in the loaded image.

[transfer full][array zero-terminated=1]

### gexiv2_metadata_clear_exif ()

    void
    gexiv2_metadata_clear_exif (GExiv2Metadata *self);

Clears all EXIF metadata from the loaded image.

#### Parameters

self | An instance of GExiv2Metadata |

### gexiv2_metadata_try_get_exif_tag_rational ()

    gboolean
    gexiv2_metadata_try_get_exif_tag_rational
                                   (GExiv2Metadata *self,
                                    const gchar *tag,
                                    gint *nom,
                                    gint *den,
                                    GError **error);

Fetch EXIF `tag` represented by a fraction. `nom` will contain the numerator, `den` the denominator of the fraction on successful return.

#### Parameters

self | An instance of GExiv2Metadata |
tag | The tag you want the rational value for. | [in]
nom | The numerator. | [out]
den | The denominator. | [out]
error | A return location for a GError or `NULL`. | [allow-none]

#### Returns

Boolean success value.

[skip]

Since: 0.12.2

### gexiv2_metadata_try_set_exif_tag_rational ()

    gboolean
    gexiv2_metadata_try_set_exif_tag_rational
                                   (GExiv2Metadata *self,
                                    const gchar *tag,
                                    gint nom,
                                    gint den,
                                    GError **error);

Set EXIF `tag` represented by a fraction, with `nom` being the numerator, `den` the denominator of the fraction.

#### Parameters

self | An instance of GExiv2Metadata |
tag | The Exiv2 tag. | [in]
nom | Rational numerator |
den | Rational denominator |
error | A return location for a GError or `NULL`. | [allow-none]

#### Returns

Boolean success value.

[skip]

Since: 0.12.2

### gexiv2_metadata_get_exif_thumbnail ()

    gboolean
    gexiv2_metadata_get_exif_thumbnail (GExiv2Metadata *self,
                                        guint8 **buffer,
                                        gint *size);

Get the thumbnail stored in the EXIF data of `self`

#### Parameters

self | An instance of GExiv2Metadata |
buffer | Where to store the thumbnail data. | [out][array length=size][transfer full]
size | Size of the thumbnail's buffer. | [skip]

#### Returns

Boolean success value.

[skip]

### gexiv2_metadata_get_exif_data ()

    GBytes *
    gexiv2_metadata_get_exif_data (GExiv2Metadata *self,
                                   GExiv2ByteOrder byte_order,
                                   GError **error);

#### Parameters

self | An instance of GExiv2Metadata |
byte_order | Whether to export the data in little or big endian format |
error | A return location for a GError or `NULL`. | [allow-none]

#### Returns

The content of the EXIF data or `NULL` on error.

[transfer full][allow-none]

Since: 0.12.2

### gexiv2_metadata_set_exif_thumbnail_from_file ()

    gboolean
    gexiv2_metadata_set_exif_thumbnail_from_file
                                   (GExiv2Metadata *self,
                                    const gchar *path,
                                    GError **error);

Sets or replaces the EXIF thumbnail with the image in the file

#### Parameters

self | An instance of GExiv2Metadata |
path | Path of image file. | [in]
error | A return location for a GError or `NULL`. | [allow-none]

#### Returns

Boolean success value

### gexiv2_metadata_try_set_exif_thumbnail_from_buffer ()

    void
    gexiv2_metadata_try_set_exif_thumbnail_from_buffer
                                   (GExiv2Metadata *self,
                                    const guint8 *buffer,
                                    gint size,
                                    GError **error);

#### Parameters

self | An instance of GExiv2Metadata |
buffer | A buffer containing thumbnail data. | [array length=size]
size | Size of the thumbnail's buffer. | [skip]
error | A return location for a GError or `NULL`. | [allow-none]

Since: 0.14.0

### gexiv2_metadata_try_erase_exif_thumbnail ()

    void
    gexiv2_metadata_try_erase_exif_thumbnail
                                   (GExiv2Metadata *self,
                                    GError **error);

Removes the EXIF thumbnail from the loaded image.

#### Parameters

self | An instance of GExiv2Metadata |
error | A return location for a GError or `NULL`. | [allow-none]

Since: 0.14.0

### gexiv2_metadata_get_exif_tag_rational ()

    gboolean
    gexiv2_metadata_get_exif_tag_rational (GExiv2Metadata *self,
                                           const gchar *tag,
                                           gint *nom,
                                           gint *den);

`gexiv2_metadata_get_exif_tag_rational` has been deprecated since version 0.12.2 and should not be used in newly-written code.

Use `gexiv2_metadata_try_get_exif_tag_rational()` instead.

Fetch EXIF `tag` represented by a fraction. `nom` will contain the numerator, `den` the denominator of the fraction on successful return.

#### Parameters

self | An instance of GExiv2Metadata |
tag | The tag you want the rational value for. | [in]
nom | The numerator. | [out]
den | The denominator. | [out]

#### Returns

Boolean success value.

[skip]

### gexiv2_metadata_set_exif_tag_rational ()

    gboolean
    gexiv2_metadata_set_exif_tag_rational (GExiv2Metadata *self,
                                           const gchar *tag,
                                           gint nom,
                                           gint den);

`gexiv2_metadata_set_exif_tag_rational` has been deprecated since version 0.12.2 and should not be used in newly-written code.

Use `gexiv2_metadata_try_set_exif_tag_rational()` instead.

Set EXIF `tag` represented by a fraction, with `nom` being the numerator, `den` the denominator of the fraction.

#### Parameters

self | An instance of GExiv2Metadata |
tag | The Exiv2 tag. | [in]
nom | Rational numerator |
den | Rational denominator |

#### Returns

Boolean success value.

[skip]

### gexiv2_metadata_set_exif_thumbnail_from_buffer ()

    void
    gexiv2_metadata_set_exif_thumbnail_from_buffer
                                   (GExiv2Metadata *self,
                                    const guint8 *buffer,
                                    gint size);

`gexiv2_metadata_set_exif_thumbnail_from_buffer` has been deprecated since version 0.14.0 and should not be used in newly-written code.

Use `gexiv2_metadata_try_set_exif_thumbnail_from_buffer()` instead.

#### Parameters

self | An instance of GExiv2Metadata |
buffer | A buffer containing thumbnail data. | [array length=size]
size | Size of the thumbnail's buffer. | [skip]

### gexiv2_metadata_erase_exif_thumbnail ()

    void
    gexiv2_metadata_erase_exif_thumbnail (GExiv2Metadata *self);

`gexiv2_metadata_erase_exif_thumbnail` has been deprecated since version 0.14.0 and should not be used in newly-written code.

Use `gexiv2_metadata_try_erase_exif_thumbnail()` instead.

Removes the EXIF thumbnail from the loaded image.

#### Parameters

self | An instance of GExiv2Metadata |