[KimDaBa] Category Images

Jean-Michel FAYARD jmfayard at gmail.com
Sat Oct 1 12:45:15 BST 2005


2005/10/1, Andrew Wilkinson <andrewjwilkinson at gmail.com>:
> Hi,
>
> I've been trying to write a program to use the kimdaba database, and a
> python library to read the database but I'm a bit stuck.
>
> I want to get access to the images for categories and the zoom
> information on those images, but it doesn't seem to be stored in the
> index.xml file - or maybe it is and I'm just going crazy...
>
> Could someone please tell me where this information is stored?
I don't know what you call zoom information, but everything is stored
in the index.xml file.

To find images belonging to a category (before it was colled option-group),
you have to parse the whole file.
<member-groups>
<member group-name="Europe" option-group="Locations" member="France" >
<member group-name="Europe" option-group="Locations" member="Deutschland" >
....
</member-groups>

Then you have to find every image which has France or Deutschland as label :
<images>
...
<image file="Folder/Sub/Picture.png" >
 <options>
     <option name="Persons">
     ...
     </option>
     <option name ="Locations">
          <value value="France">
     </option>
 </options>
</image>
...


Now you know that "Folder/Sub/Picture.png" has location France which
is a member of Europe, so "Folder/Sub/Picture.png" belongs to the
member-group Europe.




Warning : the index.xml file format was changed the third december 2004, so that
option-group is now called category. In Image::Kimdaba, I had to write :

sub member {
    my ( $p, $el, %attrs ) = @_ ;
    my ($groupname,$member) =
	( $attrs{"group-name"}, $attrs{"member"} );
    # index.xml format has changed at Fri Dec 3
    my $category=$attrs{"option-group"} if ( exists $attrs{"option-group"}  );
    $category=$attrs{"category"} if ( exists $attrs{"category"}  );
	...
}




More information about the Kphotoalbum mailing list