Method

GimpProcedureConfigbegin_export

unstable since: 3.0

Declaration [src]

GimpMetadata*
gimp_procedure_config_begin_export (
  GimpProcedureConfig* config,
  GimpImage* original_image,
  GimpRunMode run_mode,
  const GimpValueArray* args,
  const gchar* mime_type
)

Description [src]

This is a variant of gimp_procedure_config_begin_run() to be used by file export procedures using GimpSaveProcedure. It must be paired with a call to gimp_procedure_config_end_export() at the end of run().

It does everything gimp_procedure_config_begin_run() does but provides additional features to automate file export:

If mime_type is non-NULL, exporting metadata is handled automatically, by calling gimp_image_metadata_save_prepare() and syncing its returned GimpMetadataSaveFlags with configs properties. (The corresponding gimp_image_metadata_save_finish() will be called by gimp_procedure_config_end_export()).

The following boolean arguments of the used GimpSaveProcedure are synced. The procedure can but must not provide these arguments.

  • save-exif” for GIMP_METADATA_SAVE_EXIF.
  • save-xmp” for GIMP_METADATA_SAVE_XMP.
  • save-iptc” for GIMP_METADATA_SAVE_IPTC.
  • save-thumbnail” for GIMP_METADATA_SAVE_THUMBNAIL.
  • save-color-profile” for GIMP_METADATA_SAVE_COLOR_PROFILE.
  • save-comment” for GIMP_METADATA_SAVE_COMMENT.

The values from the GimpMetadataSaveFlags will only ever be used to set these properties to FALSE, overriding the user’s saved default values for the procedure, but NOT overriding the last used values from exporting original_image or the last used values from exporting any other image using this procedure.

If mime_type is NULL, GimpMetadata handling is skipped. The procedure can still have all of the above listed boolean arguments, but must take care of their default values itself. The easiest way to do this is by simply using gimp_export_comment(), gimp_export_exif() etc. as default values for these arguments when adding them using GIMP_PROC_ARG_BOOLEAN() or GIMP_PROC_AUX_ARG_BOOLEAN().

Available since: 3.0

Parameters

original_image

Type: GimpImage

The image passed to run()

The data is owned by the caller of the function.
run_mode

Type: GimpRunMode

The GimpRunMode passed to a GimpProcedure‘s run()

args

Type: GimpValueArray

The value array passed to a GimpProcedure‘s run()

The data is owned by the caller of the function.
mime_type

Type: const gchar*

Exported file format’s mime type, or NULL.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Return value

Type: GimpMetadata

The metadata to be used for this export, or NULL if original_image doesn’t have metadata.

The data is owned by the instance.
The return value can be NULL.