Reply
Thread Tools
jaywink's Avatar
Posts: 46 | Thanked: 26 times | Joined on Dec 2007 @ Helsinki
#1
Hi all,

I have a little sharing app in development for the N9 Harmattan. I'd like to add hashtag support (twitter, diaspora, etc) and would like to enable the user to choose from the same tags as the Gallery. I would need to not only read the tags, but save new tags as well.

Any pointers to code relating to the tag chooser in the Nokia N9 Gallery app? Or at least what API could be used to access the tags?

Looked around various places for hours and cannot find anything

Thanks!

Br,
Jason
__________________
http://www.basshero.org
 
Posts: 1,096 | Thanked: 760 times | Joined on Dec 2008
#2
the tags are stored in the image itself

See xmp standard
http://ns.adobe.com/xap/1.0/

what you are looking for is stored in

dc:subject


tracker might also keep a list of tag data for photos, idk, would make things like filter by tag easier

here is the data in a photo I tagged using N9 with 'food' and 'tedt'

Code:
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Exempi + XMP Core 4.4.0">
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about=""
    xmlns:exif="http://ns.adobe.com/exif/1.0/"
    xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:xmp="http://ns.adobe.com/xap/1.0/"
   exif:NativeDigest="36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;96064CBBB982FC9EF78639C495C194E3"
   exif:ExposureBiasValue="0/1"
   exif:DateTimeOriginal="2012-01-29T10:28:24.268000-04:58"
   exif:ExposureTime="31/1000"
   exif:FNumber="11/5"
   exif:ExposureProgram="0"
   exif:ShutterSpeedValue="467760638/93335813"
   exif:ApertureValue="122425887/53813410"
   exif:MeteringMode="1"
   exif:FocalLength="28/1"
   exif:ExposureMode="0"
   exif:WhiteBalance="0"
   exif:DigitalZoomRatio="1/1"
   exif:SceneCaptureType="0"
   exif:GainControl="3"
   exif:Contrast="0"
   exif:Saturation="0"
   exif:Sharpness="0"
   exif:ExifVersion="0230"
   exif:FlashpixVersion="0100"
   exif:FileSource="3"
   exif:Date="2012-01-29T15:28:24Z"
   exif:Title="20120129 001"
   exif:Orientation="top - left"
   tiff:NativeDigest="256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,33432;006EF1F055196E10731219DB0CE0FC0C"
   tiff:Orientation="1"
   tiff:Make="Nokia"
   tiff:Model="N9"
   dc:format="image/jpeg"
   dc:date="2012-01-29T15:28:24Z"
   dc:title="20120129 001"
   dc:contributor="myname"
   dc:creator="myname"
   dc:subject="Food, Tedt"
   xmp:ModifyDate="2012-01-29T10:28:24"
   xmp:CreateDate="2012-01-29T10:28:24.268000-04:58">
   <exif:ISOSpeedRatings>
    <rdf:Seq>
     <rdf:li>151</rdf:li>
    </rdf:Seq>
   </exif:ISOSpeedRatings>
   <exif:Flash
    exif:Fired="True"
    exif:Return="0"
    exif:Mode="3"
    exif:Function="False"
    exif:RedEyeMode="False"/>
  </rdf:Description>
 </rdf:RDF>
</x:xmpmeta>
 
jaywink's Avatar
Posts: 46 | Thanked: 26 times | Joined on Dec 2007 @ Helsinki
#3
Originally Posted by quipper8 View Post
the tags are stored in the image itself

See xmp standard
http://ns.adobe.com/xap/1.0/

what you are looking for is stored in

dc:subject


tracker might also keep a list of tag data for photos, idk, would make things like filter by tag easier
I'm quite sure there must be some sort of tag database since the same tags are always available even when not adding them to images. If I go to Share UI and choose to share my image to Picasa/Flickr for example, I can choose tags from a tag cloud that has all the tags I've previously added. So tags are stored somewhere centrally where the gallery and Share UI get to use them.

Tracker might be an answer but doesn't it just index files and file metadata?

But thanks anyway for your reply
__________________
http://www.basshero.org
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#4
They are saved in the tracker database, even when they aren't used
in the image tags anymore.

tracker-sparql -q "select nao:prefLabel(?d) where { ?d a nao:Tag}"
 

The Following 3 Users Say Thank You to nicolai For This Useful Post:
jaywink's Avatar
Posts: 46 | Thanked: 26 times | Joined on Dec 2007 @ Helsinki
#5
Cool thanks nicolai, exactly what I was looking for! Need to look at how to use the QtSparql from my app.
__________________
http://www.basshero.org
 
jaywink's Avatar
Posts: 46 | Thanked: 26 times | Joined on Dec 2007 @ Helsinki
#6
Any idea why this QML fails in QtCreator and device (N9 PR1.1)?

import QtSparql 1.0
http://harmattan-dev.nokia.com/docs/...del.html?tab=1

Got a hint to try 0.1, which works on device, but 'SparqlListModel' is not recognized.

Something related to PR1.2 which is in the docs already?
__________________
http://www.basshero.org
 
jaywink's Avatar
Posts: 46 | Thanked: 26 times | Joined on Dec 2007 @ Helsinki
#7
Started working with Python-QtSparql.

Got access denied to tracker DB and set up Aegis permissions to read/write. However, query returns this error:

QTrackerDirectSyncResult: QSparqlError(9, "GDBus.Errorrg.freedesktop.DBus.Error.AccessDeni ed: Rejected send message, 2 matched rules; type="method_call", sender=":1.404" (uid=29999 pid=17355 comm="/usr/bin/python /opt/sharetus/sharetus.py http://w") interface="org.freedesktop.Tracker1.Steroids" member="Query" error name="(unset)" requested_reply=0 destination="org.freedesktop.Tracker1" (uid=29999 pid=1327 comm="/usr/lib/tracker/tracker-store "))", 4) "select naorefLabel(?d) where { ?d a nao:Tag}"
I checked permissions for the PID and they seem ok:

~ $ accli -p 1327 -I
Credentials:
UID::user
GID::metadata-users
SRC::com.nokia.maemo
AID::com.nokia.maemo.tracker.
TrackerReadAccess
TrackerWriteAccess
tracker::tracker
tracker::tracker-extract-access
tracker::tracker-miner-fs-access
So it looks ok to me. Ideas, anyone?
__________________
http://www.basshero.org
 
Posts: 3 | Thanked: 1 time | Joined on Jan 2012
#8
Originally Posted by jaywink View Post
Any idea why this QML fails in QtCreator and device (N9 PR1.1)?



http://harmattan-dev.nokia.com/docs/...del.html?tab=1

Got a hint to try 0.1, which works on device, but 'SparqlListModel' is not recognized.

Something related to PR1.2 which is in the docs already?
You need the PR1.2 SDK/Update to use the SparqlListModel, I assume it's in the documentation already because of the N950 update.
 

The Following User Says Thank You to radiofree For This Useful Post:
Posts: 3 | Thanked: 1 time | Joined on Jan 2012
#9
Originally Posted by jaywink View Post
So it looks ok to me. Ideas, anyone?
Does it work with GRP::metadata-users?
 
jaywink's Avatar
Posts: 46 | Thanked: 26 times | Joined on Dec 2007 @ Helsinki
#10
Originally Posted by radiofree View Post
Does it work with GRP::metadata-users?
Actually it seems it was my mistake in looking at the wrong PID. But also it seems launching python via the command line and launching it via the Share UI get different permissions. The latter seems to work correctly.

See this post:
http://www.developer.nokia.com/Commu...l=1#post881097

But thanks anyway!
__________________
http://www.basshero.org
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 17:01.