tracker r3104 - in trunk: . data/services src/tracker-extract



Author: mottela
Date: Wed Mar 18 17:20:19 2009
New Revision: 3104
URL: http://svn.gnome.org/viewvc/tracker?rev=3104&view=rev

Log:
Added sublocation property to images.

Modified:
   trunk/ChangeLog
   trunk/data/services/image.metadata
   trunk/src/tracker-extract/tracker-iptc.c
   trunk/src/tracker-extract/tracker-xmp.c

Modified: trunk/data/services/image.metadata
==============================================================================
--- trunk/data/services/image.metadata	(original)
+++ trunk/data/services/image.metadata	Wed Mar 18 17:20:19 2009
@@ -133,6 +133,11 @@
 Description=Location where the image was taken or the location shown in the image.
 DataType=string
 
+[Image:Sublocation]
+DisplayName=Sublocation
+Description=Further detailed location where the image was taken or the
+location shown in the image.
+
 [Image:Country]
 DisplayName=Country
 Description=Country where the image was taken or the country shown in the image.

Modified: trunk/src/tracker-extract/tracker-iptc.c
==============================================================================
--- trunk/src/tracker-extract/tracker-iptc.c	(original)
+++ trunk/src/tracker-extract/tracker-iptc.c	Wed Mar 18 17:20:19 2009
@@ -45,6 +45,7 @@
 static IptcTagType iptctags[] = {
         { 2, IPTC_TAG_KEYWORDS, "Image:Keywords", NULL },
 	{ 2, IPTC_TAG_CONTENT_LOC_NAME, "Image:Location", NULL },
+	{ 2, IPTC_TAG_SUBLOCATION, "Image:Sublocation", NULL },
         { 2, IPTC_TAG_DATE_CREATED, "Image:Date", NULL },
         { 2, IPTC_TAG_ORIGINATING_PROGRAM, "Image:Software", NULL },
         { 2, IPTC_TAG_BYLINE, "Image:Creator", NULL },
@@ -93,8 +94,16 @@
 		if (strcmp (key, "Image:Keywords") == 0) {
 			g_hash_table_insert (metadata,
 					     g_strdup ("Image:HasKeywords"),
-					     tracker_escape_metadata ("1"));
-		}
+					     tracker_escape_metadata ("1"));			
+		}		
+	}
+
+	/* Adding certain fields also to keywords FIXME Postprocessing is evil */
+	if ((strcmp (key, "Image:Location") == 0) ||
+	    (strcmp (key, "Image:Sublocation") == 0) ||
+	    (strcmp (key, "Image:Country") == 0) ||
+	    (strcmp (key, "Image:City") == 0) ) {
+		metadata_append (metadata, "Image:Keywords", value);
 	}
 }
 

Modified: trunk/src/tracker-extract/tracker-xmp.c
==============================================================================
--- trunk/src/tracker-extract/tracker-xmp.c	(original)
+++ trunk/src/tracker-extract/tracker-xmp.c	Wed Mar 18 17:20:19 2009
@@ -396,6 +396,13 @@
 		        tracker_append_string_to_hash_table (metadata, "Image:Keywords", value, TRUE, FALSE);
 			tracker_append_string_to_hash_table (metadata, "Image:HasKeywords", "1", FALSE, FALSE);
 		}
+		if (strcmp (name, "Sublocation") == 0) {
+		        tracker_append_string_to_hash_table (metadata, "Image:Sublocation", value, append, FALSE);
+			
+			/* Added to the valid keywords */
+		        tracker_append_string_to_hash_table (metadata, "Image:Keywords", value, TRUE, FALSE);
+			tracker_append_string_to_hash_table (metadata, "Image:HasKeywords", "1", FALSE, FALSE);
+		}
 	}
 	/* Photoshop scheme */
 	else if (strcmp (schema,  NS_PHOTOSHOP) == 0) {



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