[KimDaBa] perl -e 'my $advice ; use Kimdaba ; "" or die'

Jesper K. Pedersen blackie at blackie.dk
Mon Jan 17 13:30:19 CET 2005


Great.
I'd like to put this on the kimdaba website (will do so tonight), or would you 
rather have me link to it somewhere?

yes the wiki seems to be down, no idea why :-(
On Monday 17 January 2005 13:26, Jean-Michel FAYARD wrote:
| Hello,
|
| I hope some people on the list will find this interesting.
| I've made a perl module ( "Kimdaba.pm" obviously)
| that makes pretty easy to use infos from the database file
| to do some quick&dirty extensions to Kimdaba,
| to test new things or whatever you want.
|
| To use it, unzip the zip file attached in your pictures directory.
|
| As examples, I've made
| - a script that convert your KimDaBa database in a format understood by
| Digikam (version >=0.7 required, and a little program called sqlite is
| required too but I think it comes with digikam)
| - a script to really rotate your pictures.
| In fact, the script does not really rotate the pictures, but it's only
| a matter of calling your favorite command-line rotating tool
| at the end of the tool.
| ( I have none and don't need one, because my digital camera correctly
| translate the picture itself, but I think there is one in the
| ImageMagick familiy)
|
| So if you want to do your own extensions (export the database in another
| format or whatever), it's quite simple, just copy and paste from
| kim_example.pl
|
| To use it, launch the kimdaba demo, let the files be stored in
| /tmp/kimdaba-demo-jmfayard or whatever, and type :
|
|    $ ./kim_example.pl /tmp/kimdaba-demo-jmfayard
|
| See, the script is pretty easy :
| ================ kim_example.pl ==================
| #!/usr/bin/perl -w
| use strict;
| use Kimdaba;
|
| my @ListOfPictures;
| my $folder=getRootFolder();
| parsedb( "$folder" );
|     # parse the xml file and create two hashes:
|     # %imageattributes	: HASH OF (url of the picture, REF. HASH OF
| (attribute, value) )
|     # %imageoptions	: HASH of (url, REF. HASH OF (optoin, REF. LIST OF
| value) )
|
| my $nb1= scalar keys %imageattributes;
| my $nb2= scalar keys %imageoptions;
| print "I've found $nb1 pictures with attributes, and $nb2 with options\n";
| printimage( (keys %imageattributes)[0] );
| printimage( (keys %imageattributes)[$nb2] );
|
| print "\n\n== NO Keywords  ==\n";
| @ListOfPictures=matchAnyOption( "Keywords" => [] );
| print join("\n", sort @ListOfPictures);
|
| print "\n\n== Holiday  ==\n";
| @ListOfPictures=matchAnyOption( "Keywords" => [ "holiday" ] );
| print join("\n", sort @ListOfPictures);
|
| print "\n\n== ANNE HELENE ==\n";
| @ListOfPictures=matchAnyOption( "Persons" => [ "Anne Helene" ] );
| print join("\n", sort @ListOfPictures);
|
| print "\n\n== ANY OF (JESPER, ANNE HELEN) ==\n";
| @ListOfPictures=matchAnyOption( "Persons" => [ "Jesper" , "Anne Helene" ]
| ); print join("\n", sort @ListOfPictures);
|
| print "\n\n== ALL OF (JESPER, ANNE HELEN) ==\n";
| @ListOfPictures=matchAllOptions( "Persons" => [ "Jesper" , "Anne Helene" ]
| ); print join("\n", sort @ListOfPictures);
|
| print "\n\n== PERSONS=Jesper, Locations=Mallorca ==\n";
| @ListOfPictures=matchAllOptions(
| 	"Persons" => [ "Jesper" ],
| 	"Locations" => [ "Mallorca" ]
| 	);
| print join("\n", sort @ListOfPictures);
|
| ==================================================
|
|
| PS : I wanted to put that on the wiki, but the website which hosts it
| is down.
|
| PS2:
| $ perl -e 'my $advice ; use Kimdaba ; "" or die'
| Died at -e line 1.

-- 
Having trouble finding a given image in your collection containing
thousands of images?

http://ktown.kde.org/kimdaba might be the answer.



More information about the KimDaBa mailing list