[gimp/gimp-2-10] plug-ins: fix #7109 exported gimp .jpg not processable in Windows Photo Viewer



commit 57f20f6facbaacc30fac293310e671b037f3cd0b
Author: Jacob Boerema <jgboerema gmail com>
Date:   Sun Nov 21 18:39:35 2021 -0500

    plug-ins: fix #7109 exported gimp .jpg not processable in Windows Photo Viewer
    
    In cases where the whole EXIF MakerNote is invalid we still load that
    MakerNote data and export it too, causing partial invalid EXIF metadata.
    We don't need to explicitly save Exif.Photo.MakerNote at all, because
    as soon as we try to save a brand specific tag exiv2 will create that
    MakerNote tag itself.
    So from now we don't save the MakerNote but only the tags that go in it.
    In issues like #2159 where exiv2 doesn't parse all tags inside certain
    brand specific MakerNotes correctly, we will still export invalid EXIF.
    That is an exiv2 issue that we can't do much about unless we remove all
    MakerNote metadata including those that we can read, which doesn't seem
    like a good idea at all.
    
    (cherry picked from commit 6840bb9ebae6cfa3da061e18762e7db9718eac32)

 libgimpbase/gimpmetadata.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/libgimpbase/gimpmetadata.c b/libgimpbase/gimpmetadata.c
index cb194e5881..fb33def3a9 100644
--- a/libgimpbase/gimpmetadata.c
+++ b/libgimpbase/gimpmetadata.c
@@ -143,7 +143,18 @@ static const gchar *unsupported_tags[] =
      (PreviewResolution, PreviewLength, PreviewImageBorders) also make no sense because
      we are not including a Pentax specific preview image. */
   "Exif.Pentax.Preview",
-  "Exif.PentaxDng.Preview"
+  "Exif.PentaxDng.Preview",
+  /* Never save the complete brand specific MakerNote data. We load and
+   * should only save the specific brand tags inside the MakerNote.
+   * Sometimes the MakerNote is invalid or exiv2 doesn't know how to parse
+   * it. In that case we still get the (invalid) MakerNote, but not the
+   * individual tags or just a subset of them.
+   * If there are recognized brand specific tags, exiv2 will create the
+   * required MakerNote itself (which in can still be invalid but that's an
+   * exiv2 issue not ours). */
+  "Exif.Photo.MakerNote",
+  "Exif.MakerNote.ByteOrder",
+  "Exif.MakerNote.Offset",
 };
 
 static const guint8 minimal_exif[] =


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