# Gimp.ProcedureConfig.begin_export

    @accepts(Gimp.ProcedureConfig, Gimp.Image, Gimp.RunMode, Gimp.ValueArray, unicode)
    @returns(Gimp.Metadata)
    def begin_export(self, original_image, run_mode, args, mime_type):
        # Python 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-None, exporting metadata is handled automatically, by calling [method@Image.metadata_save_prepare] and syncing its returned [flags@MetadataSaveFlags] with self'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 None, [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

self

  a Gimp.ProcedureConfig

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 None.

Returns