Gimp.ProcedureConfig.prototype.begin_export

function begin_export(original_image: Gimp.Image, run_mode: Gimp.RunMode, args: Gimp.ValueArray, mime_type: String): Gimp.Metadata {
    // Gjs wrapper for gimp_procedure_config_begin_export()
}
  

This is a variant of [method@ProcedureConfig.begin_run] to be used by file export procedures using [class@SaveProcedure]. It must be paired with a call to [method@ProcedureConfig.end_export] at the end of run().

It does everything [method@ProcedureConfig.begin_run] does but provides additional features to automate file export:

If mime_type is non-null, exporting metadata is handled automatically, by calling [method@Image.metadata_save_prepare] and syncing its returned [flags@MetadataSaveFlags] with config's properties. (The corresponding [method@Image.metadata_save_finish] will be called by [method@ProcedureConfig.end_export]).

The following boolean arguments of the used [class@SaveProcedure] are synced. The procedure can but must not provide these arguments.

- "save-exif" for Gimp.MetadataSaveFlags.exif. - "save-xmp" for Gimp.MetadataSaveFlags.xmp. - "save-iptc" for Gimp.MetadataSaveFlags.iptc. - "save-thumbnail" for Gimp.MetadataSaveFlags.thumbnail. - "save-color-profile" for Gimp.MetadataSaveFlags.color_profile. - "save-comment" for Gimp.MetadataSaveFlags.comment.

The values from the [flags@MetadataSaveFlags] 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, [class@Metadata] 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 [func@export_comment], [func@export_exif] etc. as default values for these arguments when adding them using GIMP_PROC_ARG_BOOLEAN() or GIMP_PROC_AUX_ARG_BOOLEAN().

Since 3.0

original_image

the image passed to run()

run_mode

the Gimp.RunMode passed to a [class@Procedure]'s run()

args

the value array passed to a [class@Procedure]'s run()

mime_type

exported file format's mime type, or null.

Returns

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