From 28237630eb1461ff32b9dbec8bfc981c75f6b2cb Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Sun, 28 Dec 2008 02:10:32 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20563985=20=E2=80=93=20jpg=20save=20dialog:?= =?UTF-8?q?=20"cancel"=20is=20treated=20like=20"commit"=20for?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-12-28 Sven Neumann Bug 563985 – jpg save dialog: "cancel" is treated like "commit" for settings * plug-ins/file-jpeg/jpeg.c (run): only attach the comment and settings to the image if the save was successful. svn path=/trunk/; revision=27843 --- ChangeLog | 8 ++++++++ plug-ins/file-jpeg/jpeg.c | 37 ++++++++++++++++++++----------------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3515b1ea3b..c59d731b14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-12-28 Sven Neumann + + Bug 563985 – jpg save dialog: "cancel" is treated like "commit" + for settings + + * plug-ins/file-jpeg/jpeg.c (run): only attach the comment and + settings to the image if the save was successful. + 2008-12-28 Sven Neumann Bug 565362 – the previously opened file is not suggested if gimp diff --git a/plug-ins/file-jpeg/jpeg.c b/plug-ins/file-jpeg/jpeg.c index fb145c28be..20b2f8a902 100644 --- a/plug-ins/file-jpeg/jpeg.c +++ b/plug-ins/file-jpeg/jpeg.c @@ -498,28 +498,31 @@ run (const gchar *name, gimp_display_delete (display_ID); else gimp_image_delete (image_ID); - } + } - /* pw - now we need to change the defaults to be whatever - * was used to save this image. Dump the old parasites - * and add new ones. */ - - gimp_image_parasite_detach (orig_image_ID, "gimp-comment"); - if (image_comment && strlen (image_comment)) + if (status == GIMP_PDB_SUCCESS) { - parasite = gimp_parasite_new ("gimp-comment", - GIMP_PARASITE_PERSISTENT, - strlen (image_comment) + 1, - image_comment); + /* pw - now we need to change the defaults to be whatever + * was used to save this image. Dump the old parasites + * and add new ones. */ + + gimp_image_parasite_detach (orig_image_ID, "gimp-comment"); + if (image_comment && strlen (image_comment)) + { + parasite = gimp_parasite_new ("gimp-comment", + GIMP_PARASITE_PERSISTENT, + strlen (image_comment) + 1, + image_comment); + gimp_image_parasite_attach (orig_image_ID, parasite); + gimp_parasite_free (parasite); + } + gimp_image_parasite_detach (orig_image_ID, "jpeg-save-options"); + + parasite = gimp_parasite_new ("jpeg-save-options", + 0, sizeof (jsvals), &jsvals); gimp_image_parasite_attach (orig_image_ID, parasite); gimp_parasite_free (parasite); } - gimp_image_parasite_detach (orig_image_ID, "jpeg-save-options"); - - parasite = gimp_parasite_new ("jpeg-save-options", - 0, sizeof (jsvals), &jsvals); - gimp_image_parasite_attach (orig_image_ID, parasite); - gimp_parasite_free (parasite); } else {