gimpmetadata: GIMP Library Reference Manual

## gimpmetadata gimpmetadata |

## Functions

GimpMetadata * | gimp_image_metadata_load_prepare ()
void | gimp_image_metadata_load_finish ()
GimpMetadata * | gimp_image_metadata_save_prepare ()
gboolean | gimp_image_metadata_save_finish ()
gint32 | gimp_image_metadata_load_thumbnail ()

## Description

## Functions

### gimp_image_metadata_load_prepare ()

    GimpMetadata *
    gimp_image_metadata_load_prepare (gint32 image_ID,
                                      const gchar *mime_type,
                                      GFile *file,
                                      GError **error);

Loads and returns metadata from `file` to be passed into `gimp_image_metadata_load_finish()`.

#### Parameters

image_ID | The image |
mime_type | The loaded file's mime-type |
file | The file to load the metadata from |
error | Return location for error |

#### Returns

The file's metadata.

Since: 2.10

### gimp_image_metadata_load_finish ()

    void
    gimp_image_metadata_load_finish (gint32 image_ID,
                                     const gchar *mime_type,
                                     GimpMetadata *metadata,
                                     GimpMetadataLoadFlags flags,
                                     gboolean interactive);

Applies the `metadata` previously loaded with `gimp_image_metadata_load_prepare()` to the image, taking into account the passed `flags` .

#### Parameters

image_ID | The image |
mime_type | The loaded file's mime-type |
metadata | The metadata to set on the image |
flags | Flags to specify what of the metadata to apply to the image |
interactive | Whether this function is allowed to query info with dialogs |

Since: 2.10

### gimp_image_metadata_save_prepare ()

    GimpMetadata *
    gimp_image_metadata_save_prepare (gint32 image_ID,
                                      const gchar *mime_type,
                                      GimpMetadataSaveFlags *suggested_flags);

Gets the image metadata for saving it using `gimp_image_metadata_save_finish()`.

The `suggested_flags` are determined from what kind of metadata (Exif, XMP, ...) is actually present in the image and the preferences for metadata exporting. The calling application may still update `available_flags` , for instance to follow the settings from a previous export in the same session, or a previous export of the same image. But it should not override the preferences without a good reason since it is a data leak.

The suggested value for GIMP_METADATA_SAVE_THUMBNAIL is determined by whether there was a thumbnail in the previously imported image.

#### Parameters

image_ID | The image |
mime_type | The saved file's mime-type |
suggested_flags | Suggested default values for the `flags` passed to `gimp_image_metadata_save_finish()` |

#### Returns

The image's metadata, prepared for saving.

Since: 2.10

### gimp_image_metadata_save_finish ()

    gboolean
    gimp_image_metadata_save_finish (gint32 image_ID,
                                     const gchar *mime_type,
                                     GimpMetadata *metadata,
                                     GimpMetadataSaveFlags flags,
                                     GFile *file,
                                     GError **error);

Saves the `metadata` retrieved from the image with `gimp_image_metadata_save_prepare()` to `file` , taking into account the passed `flags` .

#### Parameters

image_ID | The image |
mime_type | The saved file's mime-type |
metadata | The metadata to set on the image |
flags | Flags to specify what of the metadata to save |
file | The file to load the metadata from |
error | Return location for error message |

#### Returns

Whether the save was successful.

Since: 2.10

### gimp_image_metadata_load_thumbnail ()

    gint32
    gimp_image_metadata_load_thumbnail (GFile *file,
                                        GError **error);