Gimp.RunVectorLoadFunc
Description: Reference for Gimp.RunVectorLoadFunc

### Function

# GimpRunVectorLoadFunc

since: 3.0

#### Declaration

    GimpValueArray*
    (* GimpRunVectorLoadFunc) (
      GimpProcedure* procedure,
      GimpRunMode run_mode,
      GFile* file,
      gint width,
      gint height,
      GimpVectorLoadData extracted_data,
      GimpMetadata* metadata,
      GimpMetadataLoadFlags* flags,
      GimpProcedureConfig* config,
      gpointer data_from_extract,
      gpointer run_data
    )

#### Description [src]

The load function is run during the lifetime of the GIMP session, each time a plug-in load procedure is called.

You are expected to read `file` and create a `GimpImage` out of its data. This image will be the first return value. `metadata` will be filled from metadata from `file` if our infrastructure supports this format. You may tweak this object, for instance adding metadata specific to the format. You can also edit `flags` if you need to filter out some specific common fields. For instance, it is customary to remove a colorspace field with `GimpMetadataLoadFlags` when a profile was added.

Regarding returned image dimensions:

1. If `width` or `height` is 0 or negative, the actual value will be computed so that ratio is preserved. If `prefer_native_dimension` is `FALSE`, at least one of the 2 dimensions should be strictly positive.
2. If `preserve_ratio` is `TRUE`, then `width` and `height` are considered as a max size in their respective dimension. I.e. that the resulting image will be at most `widthx`@height while preserving original ratio. `preserve_ratio` is implied when any of the dimension is 0 or negative.
3. If `prefer_native_dimension` is `TRUE`, and if the image has some kind of native size (if the format has such metadata or it can be computed), it will be used rather than `widthx`@height. Note that if both dimensions are 0 or negative, even if `prefer_native_dimension` is TRUE yet the procedure cannot determine native dimensions, then maybe a dialog could be popped up (if implemented), unless the `run_mode` is `GIMP_RUN_NONINTERACTIVE`.

Available since: 3.0

#### Parameters

`procedure`

  Type: `GimpProcedure`

  The `GimpProcedure` that runs.

  The data is owned by the caller of the function.

`run_mode`

  Type: `GimpRunMode`

  The `GimpRunMode`.

`file`

  Type: `GFile`

  The `GFile` to load from.

  The data is owned by the caller of the function.

`width`

  Type: `gint`

  The desired width in pixel for the created image.

`height`

  Type: `gint`

  The desired height in pixel for the created image.

`extracted_data`

  Type: `GimpVectorLoadData`

  Dimensions returned by `GimpExtractVectorFunc`.

`metadata`

  Type: `GimpMetadata`

  The `GimpMetadata` which will be added to the new image.

  The data is owned by the caller of the function.

`flags`

  Type: `GimpMetadataLoadFlags`

  Flags to filter which metadata will be added..

  The argument will be modified by the function.
  The caller of the function takes ownership of the returned data, and is responsible for freeing it.

`config`

  Type: `GimpProcedureConfig`

  The `procedure`‘s remaining arguments.

  The data is owned by the caller of the function.

`data_from_extract`

  Type: `gpointer`

  `data_for_run` returned by `GimpExtractVectorFunc`.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`run_data`

  Type: `gpointer`

  `run_data` given in gimp_vector_load_procedure_new().

  The argument can be `NULL`.
  The data is owned by the caller of the function.

#### Return value

Type: `GimpValueArray`

The `procedure`‘s return values.

The caller of the function takes ownership of the data, and is responsible for freeing it.