[tracker/gnome-screenshot] Detect screenshots made by a GNOME desktop and add them to a category container



commit 2e0f0f6e9fe3c2284974f915258072b1575e3779
Author: Philip Van Hoof <pvanhoof sput-debian>
Date:   Tue Oct 8 10:25:28 2013 +0200

    Detect screenshots made by a GNOME desktop and add them to a category container
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709368

 data/ontologies/33-nfo.ontology           |   11 ++++++++++-
 src/tracker-extract/tracker-extract-png.c |   11 +++++++++++
 2 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/data/ontologies/33-nfo.ontology b/data/ontologies/33-nfo.ontology
index 3fc09aa..601d6eb 100644
--- a/data/ontologies/33-nfo.ontology
+++ b/data/ontologies/33-nfo.ontology
@@ -12,7 +12,7 @@
 
 nfo: a tracker:Namespace, tracker:Ontology ;
        tracker:prefix "nfo" ;
-       nao:lastModified "2011-12-15T18:51:25Z" .
+       nao:lastModified "2013-10-08T10:00:00Z" .
 
 nfo:Document a rdfs:Class ;
        rdfs:label "Document" ;
@@ -842,6 +842,15 @@ nfo:uri a rdf:Property ;
 
 # Added
 
+# Philip's proposal for image categories (ie. 'screenshot')
+
+nfo:ImageCategory a rdfs:Class ;
+        rdfs:label "Image category" ;
+        rdfs:comment "A image category" ;
+        rdfs:subClassOf nfo:DataContainer, nie:InformationElement .
+
+nfo:image-category-screenshot a nfo:ImageCategory .
+
 nfo:SoftwareCategory a rdfs:Class ;
        rdfs:label "Software" ;
        rdfs:comment "A software category" ;
diff --git a/src/tracker-extract/tracker-extract-png.c b/src/tracker-extract/tracker-extract-png.c
index 58d19d3..91acede 100644
--- a/src/tracker-extract/tracker-extract-png.c
+++ b/src/tracker-extract/tracker-extract-png.c
@@ -68,6 +68,7 @@ typedef struct {
        gchar *creation_time;
        const gchar *title;
        const gchar *disclaimer;
+       const gchar *software;
 } PngData;
 
 static gchar *
@@ -329,6 +330,11 @@ read_metadata (TrackerSparqlBuilder *preupdate,
                                pd.disclaimer = text_ptr[i].text;
                                continue;
                        }
+
+                       if (g_strcmp0(text_ptr[i].key, "Software") == 0) {
+                               pd.software = text_ptr[i].text;
+                               continue;
+                       }
                }
        }
 
@@ -737,6 +743,11 @@ read_metadata (TrackerSparqlBuilder *preupdate,
        }
        g_ptr_array_free (keywords, TRUE);
 
+       if (g_strcmp0(pd.software, "gnome-screenshot") == 0) {
+               tracker_sparql_builder_predicate (metadata, "nie:isPartOf");
+               tracker_sparql_builder_object (metadata, "nfo:image-category-screenshot");
+       }
+
        tracker_exif_free (ed);
        tracker_xmp_free (xd);
        g_free (pd.creation_time);


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