mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-10-06 01:12:40 +02:00
pdb: Set image file when using gimp-file-save
gimp_file_save () lets you save an image to any supported file format, but it did not update the GimpImage's file or exported file accordingly. This patch adds code to do just that, patterned after /app/file/file-save.c's file_save ().
This commit is contained in:
@@ -306,6 +306,28 @@ HELP
|
||||
gimp_object_get_name (proc),
|
||||
new_args);
|
||||
|
||||
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) ==
|
||||
GIMP_PDB_SUCCESS)
|
||||
{
|
||||
GimpImage *image =
|
||||
g_value_get_object (gimp_value_array_index (new_args, 1));
|
||||
|
||||
if (! strcmp (gimp_object_get_name (proc), "gimp-xcf-save"))
|
||||
{
|
||||
gimp_image_set_file (image, file);
|
||||
|
||||
gimp_image_set_imported_file (image, NULL);
|
||||
gimp_image_clean_all (image);
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_image_set_exported_file (image, file);
|
||||
gimp_image_set_export_proc (image, file_proc);
|
||||
|
||||
gimp_image_set_imported_file (image, NULL);
|
||||
gimp_image_export_clean_all (image);
|
||||
}
|
||||
}
|
||||
gimp_value_array_unref (new_args);
|
||||
|
||||
return return_vals;
|
||||
|
Reference in New Issue
Block a user