[gimp/gimp-2-10] plug-ins: file-tiff-save looks for the wrong exif tags to delete.



commit 4631cbd01510ead88abee3cfefdc086756971d72
Author: Jacob Boerema <jgboerema gmail com>
Date:   Fri Oct 23 12:46:34 2020 -0400

    plug-ins: file-tiff-save looks for the wrong exif tags to delete.
    
    The correct tag for sub images is Exif.SubImage instead of
    Exif.Image. I also added Exif.Image.InterColorProfile since
    that didn't seem to get deleted when saving without
    color profile.
    
    Also added a FIXME note since most of this stuff should be
    genealized for all gimpmetadata handling.
    
    (cherry picked from commit c10bb098b4c3ef83dbc859acb58d1a59d286c7ee)
    
    # Conflicts:
    #       plug-ins/file-tiff/file-tiff-save.c

 plug-ins/file-tiff/file-tiff-save.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/plug-ins/file-tiff/file-tiff-save.c b/plug-ins/file-tiff/file-tiff-save.c
index 14e2f471cb..fc2a393f99 100644
--- a/plug-ins/file-tiff/file-tiff-save.c
+++ b/plug-ins/file-tiff/file-tiff-save.c
@@ -852,6 +852,10 @@ save_thumbnail (TiffSaveVals *tsvals,
     }
 }
 
+/* FIXME Most of the stuff in save_metadata except the
+ * thumbnail saving should probably be moved to
+ * gimpmetadata.c and gimpmetadata-save.c.
+ */
 static void
 save_metadata (GFile                 *file,
                TiffSaveVals          *tsvals,
@@ -868,12 +872,14 @@ save_metadata (GFile                 *file,
    * we also clear some other tags that were only meaningful
    * for the original imported image.
    */
-  static const gchar *exif_tags_to_remove[] = {
-    "Exif.Image.0x0118",
-    "Exif.Image.0x0119",
-    "Exif.Image.0x011d",
+  static const gchar *exif_tags_to_remove[] =
+  {
+    "Exif.Image.0x0118",  /* MinSampleValue */
+    "Exif.Image.0x0119",  /* MaxSampleValue */
+    "Exif.Image.0x011d",  /* PageName */
     "Exif.Image.Compression",
     "Exif.Image.FillOrder",
+    "Exif.Image.InterColorProfile",
     "Exif.Image.NewSubfileType",
     "Exif.Image.PageNumber",
     "Exif.Image.PhotometricInterpretation",
@@ -897,9 +903,9 @@ save_metadata (GFile                 *file,
   exif_tags = gexiv2_metadata_get_exif_tags (GEXIV2_METADATA(metadata));
   for (char **tag = exif_tags; *tag; tag++)
     {
-      if (g_str_has_prefix (*tag, "Exif.Image")
-          && (*tag)[strlen ("Exif.Image")] >= '0'
-          && (*tag)[strlen ("Exif.Image")] <= '9')
+      if (g_str_has_prefix (*tag, "Exif.SubImage")
+          && (*tag)[strlen ("Exif.SubImage")] >= '0'
+          && (*tag)[strlen ("Exif.SubImage")] <= '9')
         gexiv2_metadata_clear_tag (GEXIV2_METADATA (metadata), *tag);
     }
 


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