gimpfile

gimpfile — Image file operations (load, save, etc.)

Functions

Description

Image file operations (load, save, etc.)

Functions

gimp_file_load ()

GimpImage *
gimp_file_load (GimpRunMode run_mode,
                GFile *file);

Loads an image file by invoking the right load handler.

This procedure invokes the correct file load handler using magic if possible, and falling back on the file's extension and/or prefix if not.

Parameters

run_mode

The run mode.

 

file

The file to load.

 

Returns

The output image.

[transfer none]


gimp_file_load_layer ()

GimpLayer *
gimp_file_load_layer (GimpRunMode run_mode,
                      GimpImage *image,
                      GFile *file);

Loads an image file as a layer for an existing image.

This procedure behaves like the file-load procedure but opens the specified image as a layer for an existing image. The returned layer needs to be added to the existing image with gimp_image_insert_layer().

Parameters

run_mode

The run mode.

 

image

Destination image.

 

file

The file to load.

 

Returns

The layer created when loading the image file.

[transfer none]

Since: 2.4


gimp_file_load_layers ()

GimpLayer **
gimp_file_load_layers (GimpRunMode run_mode,
                       GimpImage *image,
                       GFile *file,
                       gint *num_layers);

Loads an image file as layers for an existing image.

This procedure behaves like the file-load procedure but opens the specified image as layers for an existing image. The returned layers needs to be added to the existing image with gimp_image_insert_layer().

Parameters

run_mode

The run mode.

 

image

Destination image.

 

file

The file to load.

 

num_layers

The number of loaded layers.

[out]

Returns

The list of loaded layers. The returned value must be freed with g_free().

[array length=num_layers][element-type GimpLayer][transfer container]

Since: 2.4


gimp_file_save ()

gboolean
gimp_file_save (GimpRunMode run_mode,
                GimpImage *image,
                gint num_drawables,
                const GimpItem **drawables,
                GFile *file);

Saves a file by extension.

This procedure invokes the correct file save handler according to the file's extension and/or prefix.

Parameters

run_mode

The run mode.

 

image

Input image.

 

num_drawables

The number of drawables to save.

 

drawables

Drawables to save.

[array length=num_drawables][element-type GimpItem]

file

The file to save the image in.

 

Returns

TRUE on success.


gimp_file_save_thumbnail ()

gboolean
gimp_file_save_thumbnail (GimpImage *image,
                          GFile *file);

Saves a thumbnail for the given image

This procedure saves a thumbnail for the given image according to the Free Desktop Thumbnail Managing Standard. The thumbnail is saved so that it belongs to the given file. This means you have to save the image under this name first, otherwise this procedure will fail. This procedure may become useful if you want to explicitly save a thumbnail with a file.

Parameters

image

The image.

 

file

The file the thumbnail belongs to.

 

Returns

TRUE on success.