[gimp/gimp-2-10] plug-ins: Let the user know if we fail to save image metadata in file-jpeg.



commit 91a91542f7f5f8bb75922d970938995583ffb132
Author: Jacob Boerema <jgboerema gmail com>
Date:   Thu Oct 15 15:06:58 2020 -0400

    plug-ins: Let the user know if we fail to save image metadata in file-jpeg.
    
    (cherry picked from commit fafe9889e07829751b515673d389f237806b62af)
    
    # Conflicts:
    #       plug-ins/file-jpeg/jpeg.c

 plug-ins/file-jpeg/jpeg.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/plug-ins/file-jpeg/jpeg.c b/plug-ins/file-jpeg/jpeg.c
index 90f42fb292..bd2f4600e3 100644
--- a/plug-ins/file-jpeg/jpeg.c
+++ b/plug-ins/file-jpeg/jpeg.c
@@ -576,10 +576,21 @@ run (const gchar      *name,
                 metadata_flags &= ~GIMP_METADATA_SAVE_COLOR_PROFILE;
 
               file = g_file_new_for_path (param[3].data.d_string);
-              gimp_image_metadata_save_finish (orig_image_ID,
-                                               "image/jpeg",
-                                               metadata, metadata_flags,
-                                               file, NULL);
+                 if (! gimp_image_metadata_save_finish (orig_image_ID,
+                                                        "image/jpeg",
+                                                        metadata, metadata_flags,
+                                                        file, &error))
+                   {
+                     if (error)
+                       {
+                         /* Even though a failure to write metadata is not enough
+                            reason to say we failed to save the image, we should
+                            still notify the user about the problem. */
+                         g_message ("%s: saving metadata failed: %s",
+                                    G_STRFUNC, error->message);
+                         g_error_free (error);
+                       }
+                   }
               g_object_unref (file);
             }
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]