[gthumb/ext] [exiv2] do not save empty comments



commit a4da6db2cb0cb3d74e5c217131153e124efb1d1d
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Mon Sep 7 23:07:36 2009 +0200

    [exiv2] do not save empty comments

 extensions/exiv2/exiv2-utils.cpp |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/extensions/exiv2/exiv2-utils.cpp b/extensions/exiv2/exiv2-utils.cpp
index 599ebbe..051ceaf 100644
--- a/extensions/exiv2/exiv2-utils.cpp
+++ b/extensions/exiv2/exiv2-utils.cpp
@@ -644,12 +644,9 @@ exiv2_write_metadata_private (Exiv2::Image::AutoPtr  image,
 			xd.erase (iter);
 
 		try {
-			/*if (strcmp (key, "Xmp.dc.description") == 0) {
-				Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::langAlt);
-				v->read(gth_metadata_get_raw (metadatum));
-				xd.add (Exiv2::XmpKey (key), v.get());
-			}
-			else FIXME */
+			const char *value = gth_metadata_get_raw (metadatum);
+
+			if ((value != NULL) && strcmp (value, "") != 0)
 				xd[key] = gth_metadata_get_raw (metadatum);
 		}
 		catch (Exiv2::AnyError& e) {



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