mirror of https://github.com/GNOME/gimp.git
Bug 727854 - Export file type should not be based on filename extension
Keep the export proc acound in the image (just as we keep around the save proc), and use it when exporting again.
This commit is contained in:
parent
189c329a2c
commit
3dbae5e4d9
|
@ -299,13 +299,14 @@ file_save_cmd_callback (GtkAction *action,
|
|||
case GIMP_SAVE_MODE_EXPORT:
|
||||
case GIMP_SAVE_MODE_OVERWRITE:
|
||||
{
|
||||
const gchar *uri = NULL;
|
||||
GimpPlugInProcedure *export_proc;
|
||||
gboolean overwrite = FALSE;
|
||||
const gchar *uri = NULL;
|
||||
GimpPlugInProcedure *export_proc = NULL;
|
||||
gboolean overwrite = FALSE;
|
||||
|
||||
if (save_mode == GIMP_SAVE_MODE_EXPORT)
|
||||
{
|
||||
uri = gimp_image_get_exported_uri (image);
|
||||
uri = gimp_image_get_exported_uri (image);
|
||||
export_proc = gimp_image_get_export_proc (image);
|
||||
|
||||
if (! uri)
|
||||
{
|
||||
|
@ -323,7 +324,7 @@ file_save_cmd_callback (GtkAction *action,
|
|||
overwrite = TRUE;
|
||||
}
|
||||
|
||||
if (uri)
|
||||
if (uri && ! export_proc)
|
||||
{
|
||||
export_proc =
|
||||
file_procedure_find (image->gimp->plug_in_manager->export_procs,
|
||||
|
|
|
@ -38,6 +38,7 @@ struct _GimpImagePrivate
|
|||
|
||||
GimpPlugInProcedure *load_proc; /* procedure used for loading */
|
||||
GimpPlugInProcedure *save_proc; /* last save procedure used */
|
||||
GimpPlugInProcedure *export_proc; /* last export procedure used */
|
||||
|
||||
gchar *display_name; /* display basename */
|
||||
gchar *display_path; /* display full path */
|
||||
|
|
|
@ -2206,6 +2206,23 @@ gimp_image_get_save_proc (const GimpImage *image)
|
|||
return GIMP_IMAGE_GET_PRIVATE (image)->save_proc;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_set_export_proc (GimpImage *image,
|
||||
GimpPlugInProcedure *proc)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_IMAGE (image));
|
||||
|
||||
GIMP_IMAGE_GET_PRIVATE (image)->export_proc = proc;
|
||||
}
|
||||
|
||||
GimpPlugInProcedure *
|
||||
gimp_image_get_export_proc (const GimpImage *image)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
|
||||
return GIMP_IMAGE_GET_PRIVATE (image)->export_proc;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_set_resolution (GimpImage *image,
|
||||
gdouble xresolution,
|
||||
|
|
|
@ -163,6 +163,9 @@ void gimp_image_set_save_proc (GimpImage *image,
|
|||
GimpPlugInProcedure * gimp_image_get_save_proc (const GimpImage *image);
|
||||
void gimp_image_saved (GimpImage *image,
|
||||
const gchar *uri);
|
||||
void gimp_image_set_export_proc (GimpImage *image,
|
||||
GimpPlugInProcedure *proc);
|
||||
GimpPlugInProcedure * gimp_image_get_export_proc (const GimpImage *image);
|
||||
void gimp_image_exported (GimpImage *image,
|
||||
const gchar *uri);
|
||||
|
||||
|
|
|
@ -198,6 +198,7 @@ file_save (Gimp *gimp,
|
|||
* of a GimpImage is the last-save URI
|
||||
*/
|
||||
gimp_image_set_exported_uri (image, uri);
|
||||
gimp_image_set_export_proc (image, file_proc);
|
||||
|
||||
/* An image can not be considered both exported and imported
|
||||
* at the same time, so stop consider it as imported now
|
||||
|
|
Loading…
Reference in New Issue