[gthumb/gthumb-3-2] Rotating image destroys XMP and IPTC metadata



commit 9d504aa9c965f3ff2b33f13f8c5b5864ff8eba39
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Dec 1 14:46:34 2013 +0100

    Rotating image destroys XMP and IPTC metadata
    
    [bug #719622]

 extensions/exiv2_tools/exiv2-utils.cpp |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/extensions/exiv2_tools/exiv2-utils.cpp b/extensions/exiv2_tools/exiv2-utils.cpp
index e1365bd..31ed04a 100644
--- a/extensions/exiv2_tools/exiv2-utils.cpp
+++ b/extensions/exiv2_tools/exiv2-utils.cpp
@@ -1116,6 +1116,7 @@ exiv2_write_metadata_private (Exiv2::Image::AutoPtr  image,
                ed["Exif.Image.DateTime"] = date_time;
                g_free (date_time);
        }
+       ed.sortByKey();
 
        // IPTC Data
 
@@ -1164,6 +1165,7 @@ exiv2_write_metadata_private (Exiv2::Image::AutoPtr  image,
 
                g_free (key);
        }
+       id.sortByKey();
        g_strfreev (attributes);
 
        // XMP Data
@@ -1174,13 +1176,6 @@ exiv2_write_metadata_private (Exiv2::Image::AutoPtr  image,
                gpointer  metadatum = (GthMetadata *) g_file_info_get_attribute_object (info, attributes[i]);
                char     *key = exiv2_key_from_attribute (attributes[i]);
 
-               // Remove existing tags of the same type.
-               // Seems to be needed for storing category keywords.
-               // Not exactly sure why!
-               /*Exiv2::XmpData::iterator iter = xd.findKey (Exiv2::XmpKey (key));
-               if (iter != xd.end ())
-                       xd.erase (iter);*/
-
                try {
                        const char *value_type;
 
@@ -1220,6 +1215,7 @@ exiv2_write_metadata_private (Exiv2::Image::AutoPtr  image,
 
                g_free (key);
        }
+       xd.sortByKey();
        g_strfreev (attributes);
 
        try {


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