[Kde-imaging] KIPI::ImageCollection and attributes()/setAttributes()

Colin Guthrie kde at colin.guthr.ie
Tue May 30 01:07:37 CEST 2006


Jesper K. Pedersen wrote:
> First of all, sorry for the late response - you know work and all :-)

Only too well ;)

> The attributes was a way to allow plugins to access the acategories 
> annotations of the host application. I dont remember much about the other 
> host applications, but let me explain how it works in KPhotoAlbum.
> 
> In KPhotoAlbum users may annotate their images using categories, and they may 
> themself specify which categories exists. I do e.g. have the categories 
> Persons, Locations, and Keywords.
> 
> This is what these attributes are about.
> If you started storing general key/value pairs using this mechanism, you would 
> make KPhotoAlbum beleive that it had new categories, so that would not really 
> be so good :-)

Ahhh, that is interesting. It's not overly clear from the kipi docs that 
this side effect exists... Perhaps this should be made clearer to 
prevent other devs accidentally adding categories to KPhotoAlbum ;)

Perhaps after this release we should work on a more specific method of 
accessing categories and such, perhaps in a way that will work with 
Digikam's "Tags" feature too (are KPhotoAlbum's categories and Digikam's 
tags more or less equivalent?).

> IIRC, some of the other plugins do actually store some data for the plugin, 
> using the KConfig mechanism. I do realize your need is per album/image, but 
> wouldn't this still be a valid way for you, you may e.g. use say the file 
> name as a key.

That's not a bad idea as a "make it work" solution and if worst comes to 
worst, it's what I will do for my work on the Gallery export, but it's 
unfortunately not 100% reliable.

 From the docs:

<quote>
KURL KIPI::ImageCollection::path() const
   	
Returns the directory for the image collection. The host application 
may, however, return anything in case this imagecollection is not a 
directory (check isDirectory()), or may return the directory of the 
first image in the collection, the root of the image collection (in case 
all images has a common root), or even an empty URL.
</quote>

Which means that for a given "Album" the results are rather undefined.

I guess it would work in most cases, but I can't help but feel a more 
structured implementation would be better.

I am happy to do the necessary work for implementing the necessary in 
kipi and at least in Digikam.

Col.

-- 

+------------------------+
|     Colin Guthrie      |
+------------------------+
| kde(at)colin.guthr.ie  |
| http://colin.guthr.ie/ |
+------------------------+



More information about the Kde-imaging mailing list