Image Kimdaba

From KDE UserBase Wiki
Revision as of 18:33, 28 October 2010 by Caig (talk | contribs) (Created page with "* Scheda avanzate: : Ignora pattern: \..*|ThumbNails|CategoryImages|index.xml")
Other languages:

Descrizione generale

Image::Kimdaba è un modulo Perl disponibile su CPAN per analizzare il database di KPhotoAlbum.

Installazione

Daremo per scontato che vuoi installare il modulo come un utente, diciamo in $HOME/local;

$ mkdir -p ~/local/bin
$ perl -MCPAN -e shell

Rispondi a un mucchio di domande la prima volta. A un certo punto devi inserire:

PREFIX=~/local

Poi, nella shell di CPAN, digita

> install Image::Kimdaba

Devi modificare due variabili d'ambiente (cambia il numero di versione di conseguenza):

export PERL5LIB=~/local/lib/perl5/site_perl/5.8.3:~/local/lib/perl5/5.8.3
export PATH="$HOME/local/bin:$PATH"

Se è tutto a posto ora è il momento di provare se funziona. Lancia la demo di Kimdaba (nel menu Aiuto) ed esegui:

$ kim_example.pl  /tmp/kimdaba-demo-$UTENTE


Aggiornamento

Grazie all'infrastruttura di CPAN devi solo digitare:

$ perl -MCPAN -e 'install Image::Kimdaba'

Installazione su Debian

Su Debian è possibile installare "automagicamente" Image::Kimdaba. Prima installa dh-make-perl e poi (come amministratore):

# dh-make-perl  --build --install --cpan Image::Kimdaba

Gli script forniti con Image::Kimdaba

{{{4}}}

40px]
40px]
Il file README su CPAN potrebbe essere più aggiornato.
Nota


Qui descriviamo gli script già fatti che potresti trovare utili.

Sincronizza i commenti tra Kimdaba e digiKam

La prima volta fai:

$ ./kim_2_digikam <rootfolder>

che creerà il database digikam.db utilizzato da digiKam (>= 0.7 e < 0.8 )

Avvia kimdaba, fai qualche cambiamento, riavvia lo script

$ ./kim_2_digikam <rootfolder>

che aggiornerà il database digikam.db (devi però riavviare digiKam per vedere le modifiche).

Aggiungi alcune categorie ad alcune immagini in digiKam e rilancia lo script

$ ./kim_2_digikam <rootfolder>

Poi puoi importare le modifiche che hai fatto con digiKam facendo in Kimdaba: File -> Importa: /tmp/digikam_export.kim

Il bello della sincronizzazione con digikam.db è che puoi quindi utilizzare il KIOSlave digikamtags:/ per navigare per persone o parole chiave o luoghi in ogni applicazioni di KDE. (E aggiungi una scheda "Kimdaba" -> url=digikamtags:/ nella barra laterale di Konqueror per esempio).

Esporta in galleria di JAlbum

Se ti piacciono davvero i molti bei modi con cui JAlbum ti permette di visualizzare le immagini, ma non sei disposto ad abbandonare KPhotoAlbum, utilizza questo script per passare i tuoi commenti di Kimdaba a JAlbum.

  • Scarica kim_jalbum.pl da qui e fai:
$ ./kim_jalbum.pl <rootfolder>

Poi scarica JAlbum ed installalo (necessario Java). Per prima cosa devi fare alcune impostazioni:

  • Scheda principale:
Cartella immagini: la cartella radice di Kimdaba
Cartella risultante: la cartella del tuo album
  • Scheda avanzate:
Ignora pattern: \..*|ThumbNails|CategoryImages|index.xml
  • Menu File -> Save as default

JAlbum only allows you to make a gallery from one folder (and its subfolders) while KPhotoAlbum does not have this restriction. Here is a solution:

In Kimdaba

  • Eventually delete the "jalbum" keyword to restart from scratch.
  • Set the "jalbum" keyword for each pictures you want to export.
  • Save your changes

In Konsole

Create a directory with symlinks to your tagged pictures :

$ kim_jalbum.pl ~/Images --exportdir ~/Syms/patou/

That's it, now use ~/Syms/patou/ as Image Directory

Auto-assign categoryimages

In Kimdaba's browser, you can see the list of the persons on your pictures by name, or by icons. In the viewer, you can assign an icon for a person of the pictures by Right click -> Show category editor, but it's a bit long if you have 500 persons. So this script will choose it for you.

$ mkdir -p <rootfolder>/CategoryImages
$ ./kim_category_images  <rootfolder>

It's faster than to set the 500 pictures by hand, isn't it? You can still use the category editor to choose a better picture for this person or that keyword, the script will not overwrite it.

Really rotate your pictures

In KPhotoAlbum, you can rotate pictures, but the pictures will not be really rotated, the rotation will only be stored in the index.xml database. To improve interoperability with other software, it's useful to really rotate. Quit Kimdaba and use this script (you need the jpegtran tool)

$ ./kim_rotate.pl <rootfolder>


Export a hierarchy of symbolic links

(This is a bit proof-of-concept for Kimdaba.pm, but could be useful when using non kde apps (see kim_2_digikam ))

Edit the first line of the script, then

$ ./kim_2_filesystem <rootfolder>

Write your own

If you need to export your comments in another format, or you want to do some fun thing not available with Kimdaba and you know a bit of Perl, you can Write your own extension , it's very easy.

If you feel the need, you can share your script with other people by editing this page and sending an email to the KPhotoAlbum mailing-list.