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



commit fafe9889e07829751b515673d389f237806b62af
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.

 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 8c5ec16b9f..bcae891e88 100644
--- a/plug-ins/file-jpeg/jpeg.c
+++ b/plug-ins/file-jpeg/jpeg.c
@@ -670,10 +670,21 @@ jpeg_save (GimpProcedure        *procedure,
           else
             metadata_flags &= ~GIMP_METADATA_SAVE_COLOR_PROFILE;
 
-          gimp_image_metadata_save_finish (orig_image,
-                                           "image/jpeg",
-                                           metadata, metadata_flags,
-                                           file, NULL);
+          if (! gimp_image_metadata_save_finish (orig_image,
+                                                 "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);
+                }
+            }
         }
     }
 


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