[KimDaBa] Feature requests

Jean-Michel FAYARD jmfayard at gmail.com
Tue Feb 1 11:42:58 GMT 2005


On Thu, 27 Jan 2005 16:31:21 +0100, Nicolas M. Thiery
<nthiery at users.sf.net> wrote:

> The following can most likely now be done with Kimdaba.pm:
>  - Batch property edition (add a keyword to all files matching ...)
Hello Thierry

This is just a particular use, the general thing is that you want to
modify Kimdaba's DB.
I just thought about doing modifications in the index.xml database, 
and I think it would be very silly to modify it directly, because one running
 instance of Kimdaba could overwrite your changes,
and because it would be far too easy to enter dumb data or to loose
data while playing with a script.

A much better solution is that the script outputs an export file (which syntax
is very simple) and to use Kimdaba to import it. I wrote an example
for that in my new
version of Kimdaba.pm 
Pretty simple as you can see, and I particulary write the new
let_me_draganddrop_pictures() I wrote, that let me choose the pictures
with
Kimdaba.

===============
# This example shows how to make change in the database
# Instead of modifying directly the database (which could easily be dangerous
# for your data), you write a kimdaba export file (*.kim)
# then you use the import fonction in kimdaba (no dangerous, you are in control)
#
# A .kim file is a zip archive containning an index.xml file, and
# a Thumbnail directory. You just have to create the index.xml file 
# (say in '/tmp') then you call :
#
#   makekimfile( "/tmp", "perl_output.kim", @ListOfPictures );
# where /tmp/index.xml is the file created by you
#	/tmp/perl_output.kim	is the resulting kimdaba import ile
#	@ListOfPictures		is a list of urls present in /tmp/index.xml

use Kimdaba;

my @ListOfPictures;

my $folder=getRootFolder();
parsedb( "$folder" );

@ListOfPictures=let_me_draganddrop_pictures();
print join("\n", sort(@ListOfPictures));
print "--\n";

my $destdir="/tmp";
open( EXPORT, "> ${destdir}/index.xml");
print EXPORT <<FIN
<?xml version="1.0" encoding="UTF-8"?>
<KimDaBa-export location="external" >
FIN
;

for my $url (@ListOfPictures)
{
    my $description="yeah! I changed the description";
    my $md5sum=md5sum( $url );
    
    my $value="Test Add Another Keyword";
    print EXPORT <<FIN
 <image description="$description" $md5sum file="$url" >
  <options>
   <option name="Keywords" >
    <value value="Test Add a keyword" />
    <value value="$value" />
   </option>
  </options>
 </image>
FIN
    ;
}

print EXPORT <<FIN
</KimDaBa-export>
FIN
;
close( EXPORT );


makekimfile( $destdir, "perl_export.kim", @ListOfPictures);
============


>  - Export back Kimdaba's image information to the original image files:
>     - Rotate "physically" the images, and clear the EXIF rotation
>       information to be coherent
>     - Update date/time information in the EXIF
>     - Update the description
>     - Possibly include the keywords in the description?
>    This will help for the interoperability with other image software

I fully agree with that aim.
Look at the archive, it contains a script that rotates the picture. It
doesn't yet do the other features, it probably should use ImageMagick
instead of jpegtran (the only thing I had on my box) and I'm waiting
for changes in kimdaba import feature to that correctly.
Any help is welcome.
box)

--- 
Allez les verts !
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kim_perl-04.zip
Type: application/zip
Size: 20283 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kphotoalbum/attachments/20050201/85ef65d6/attachment.zip>


More information about the Kphotoalbum mailing list