[Kde-imaging] gwenview, digikam, keywords and metadata

Kristian Rink kawazu428 at gmail.com
Thu Nov 29 08:05:50 UTC 2012


Hi Aurélien, all;

Am Dienstag, 27. November 2012, 15:50:05 schrieb Aurélien Gâteau:
> > Yes, I already stumbled across the Nepomuks Python API. Takes a bit of
> > getting used to it, though. :) I'll see where it will take me. By now,
> > thanks a bunch for your comments! :)
> 
> Great! Keep us posted with your progress on this topic.

Well, after all, and after playing a bit with things this morning on the 
train, I figured out that pyexiv2 is quite straightforward and also PyKDE4s 
Nepomuk API is way friendlier than I thought, at first look. 

See attached. So far my implementation is thoroughly pathetic: No error 
handling, to start with. No actual "syncing" of keywords (but rather just 
writing any Nepomuk keywords back to the file, effectively overwriting any 
previously stored keywords if there were any). Possibly no sane dealing with 
_all_ Nepomuk data (looking for tags and assuming tag labels to be the 
information needed). Possibly keywords not being retrieved by external 
applications as it seems there's a bunch of fields asides 
Iptc.Application2.Keywords to be used for such information (AFAICT digikam 
uses to write these to at least three or four different IPTC / EXIF tags). But 
ultimately, it works, and it does write things found in Nepomuk back to the 
image. I'll try pushing this to my github repo and spend some more work on it 
sooner or later to make it more useful.

Anyway, it shouldn't do any bad things by now but maybe it's still better to 
try this on copies of images. ;)

Speaking of copies, however: It feels interesting to, in Nepomuks API, stumble 
across the same "issue" we at the moment are facing in our semantic media 
store. Given Nepomuk stores knowledge about "file" resources identified by a 
physical file system path, what happens to image metadata stored in there in 
case any of the image files gets copied or moved, at worst while Nepomuk/KDE 
is not running (Unix shell, some other desktop environment, ...)? This seems 
like just begging for inconsistency. But possibly this is a bit off-topic 
here. :)

Cheers and all the best, 
Kristian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nepomuk2exiv.py
Type: text/x-python
Size: 923 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-imaging/attachments/20121129/187bc9d1/attachment.py>


More information about the Kde-imaging mailing list