[tracker] tracker-writeback: XMP: Don't writeback fields that are typically set by the camera itself



commit 0bdbd13fb4c95d2bdcae1724ef90620a32ef766a
Author: Philip Van Hoof <philip codeminded be>
Date:   Fri May 21 15:30:20 2010 +0200

    tracker-writeback: XMP: Don't writeback fields that are typically set by the camera itself

 src/tracker-writeback/tracker-writeback-xmp.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-writeback/tracker-writeback-xmp.c b/src/tracker-writeback/tracker-writeback-xmp.c
index c67552c..1b53863 100644
--- a/src/tracker-writeback/tracker-writeback-xmp.c
+++ b/src/tracker-writeback/tracker-writeback-xmp.c
@@ -269,6 +269,12 @@ writeback_xmp_update_file_metadata (TrackerWritebackFile *wbf,
 			}
 		}
 
+#ifdef SET_TYPICAL_CAMERA_FIELDS
+		/* Default we don't do this, we shouldn't overwrite fields that are 
+		 * typically set by the camera itself. What do we know (better) than
+		 * the actual camera did, anyway? Even if the user overwrites them in
+		 * the RDF store ... (does he know what he's doing anyway?) */
+
 		if (g_strcmp0 (row[2], TRACKER_NMM_PREFIX "meteringMode") == 0) {
 
 			xmp_delete_property (xmp, NS_EXIF, "MeteringMode");
@@ -318,13 +324,17 @@ writeback_xmp_update_file_metadata (TrackerWritebackFile *wbf,
 
 			if (g_strcmp0 (row[3], TRACKER_NMM_PREFIX "flash-on") == 0) {
 				/* 0 = Flash did not fire
-				   1 = Flash fired */
+				 * 1 = Flash fired */
 				xmp_set_property (xmp, NS_EXIF, "Flash", "1", 0);
 			} else {
 				xmp_set_property (xmp, NS_EXIF, "Flash", "0", 0);
 			}
 		}
 
+
+		/* TODO: Don't write row[3] as-is here, read xmp_specification.pdf,
+		   page 84 (bottom). */
+
 		if (g_strcmp0 (row[2], TRACKER_NMM_PREFIX "focalLength") == 0) {
 			xmp_delete_property (xmp, NS_EXIF, "FocalLength");
 			xmp_set_property (xmp, NS_EXIF, "FocalLength", row[3], 0);
@@ -345,6 +355,7 @@ writeback_xmp_update_file_metadata (TrackerWritebackFile *wbf,
 			xmp_set_property (xmp, NS_EXIF, "FNumber", row[3], 0);
 		}
 
+
 		if (g_strcmp0 (row[2], TRACKER_NMM_PREFIX "camera") == 0) {
 			gchar *work_on = g_strdup (row[3]);
 			gchar *ptr = strchr (work_on, ' ');
@@ -366,6 +377,7 @@ writeback_xmp_update_file_metadata (TrackerWritebackFile *wbf,
 
 			g_free (work_on);
 		}
+#endif /* SET_TYPICAL_CAMERA_FIELDS */
 
 		if (g_strcmp0 (row[2], TRACKER_MLO_PREFIX "location") == 0 ||
 		    g_strcmp0 (row[2], TRACKER_MLO_PREFIX "city") == 0     ||



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