Image Kimdaba: Difference between revisions

From KDE UserBase Wiki
m (Added language navigation bar)
(Kimdaba application is now called KPhotoAlbum)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:I18n/Language Navigation Bar|Image_Kimdaba}}
<languages />
<translate>


==General Description==
==General Description== <!--T:1-->
'''Image::Kimdaba''' is a Perl module available on [http://cpan.org CPAN] for parsing the [[KPhotoAlbum]] database


==Installation==
<!--T:2-->
Here we will assume that you want to install the module as a user, say in &#039;&#039;$HOME/local&#039;&#039;
'''Image::Kimdaba''' is a Perl module available on [http://cpan.org CPAN] for parsing the [[Special:myLanguage/KPhotoAlbum|KPhotoAlbum]] database


    $''' mkdir -p ~/local/bin'''
==Installation== <!--T:3-->
    $''' perl -MCPAN -e shell'''
 
<!--T:4-->
Here we will assume that you want to install the module as a user, say in ''$HOME/local'';
 
<!--T:5-->
{{Input|1=$''' mkdir -p ~/local/bin'''
$''' perl -MCPAN -e shell'''}}
 
<!--T:6-->
Answer a bunch of question the first time. At some point, you have to enter:
Answer a bunch of question the first time. At some point, you have to enter:
    '''PREFIX=~/local'''
{{Input|1='''PREFIX=~/local'''}}


<!--T:7-->
Then, in the CPAN shell, type
Then, in the CPAN shell, type
    &gt;''' install Image::Kimdaba
{{Input|1=>''' install Image::Kimdaba}}
 
<!--T:8-->
You need to modify two environment variables (change the version number accordingly):


You need to modify two environment variables:
<!--T:9-->
{{Input|1=export PERL5LIB=~/local/lib/perl5/site_perl/5.8.3:~/local/lib/perl5/5.8.3
export PATH="$HOME/local/bin:$PATH"}}


  '''export PERL5LIB=~/local/lib/perl5/site_perl/5.8.3:~/local/lib/perl5/5.8.3'''
<!--T:10-->
  '''export PATH=&quot;$HOME/local/bin:$PATH&quot;'''
If everything is OK, it's now time to test if it works. Launch '''KPhotoAlbum's''' demo (in the <menuchoice>Help</menuchoice> menu) and run:


If everything is OK, it&#039;s now time to test if it works. Launch Kimdaba&#039;s demo (in the help menu) and run:
<!--T:11-->
{{Input|1=$ kim_example.pl  /tmp/kphotoalbum-demo-$USER}}


  $''' kim_example.pl  /tmp/kimdaba-demo-$USER'''


== Upgrade == <!--T:12-->


== Upgrade ==
<!--T:13-->
Thanks to the CPAN infrastructure, you only need to type:
Thanks to the CPAN infrastructure, you only need to type:


  $ '''perl -MCPAN -e &#039;install Image::Kimdaba&#039;'''
<!--T:14-->
{{Input|1=$ perl -MCPAN -e 'install Image::Kimdaba' }}


== Installation on Debian ==
== Installation on Debian == <!--T:15-->


On Debian it&#039;s possible to automagically install Image::Kimdaba . Install first dh-make-perl, and then (as root) :
<!--T:16-->
On Debian it's possible to automagically install Image::Kimdaba . Install first '''dh-make-perl''', and then (as root) :


  #''' dh-make-perl  --build --install --cpan Image::Kimdaba'''
<!--T:17-->
{{Input|1=# dh-make-perl  --build --install --cpan Image::Kimdaba}}


== Scripts coming with Image::Kimdaba ==
== Scripts coming with Image::Kimdaba == <!--T:18-->


Note: The [http://search.cpan.org/src/JMFAYARD/Image-Kimdaba-0.4/README README] file on CPAN may be moreup to date.
<!--T:19-->
{{Note|1=The [http://search.cpan.org/src/JMFAYARD/Image-Kimdaba-0.5/README README] file on CPAN may be more up to date.}}


<!--T:20-->
Here we describe scripts already made that you may find useful.
Here we describe scripts already made that you may find useful.


== Synchronize comments between Kimdaba and Digikam ==
== Synchronize comments between KPhotoAlbum and digiKam == <!--T:21-->
    The first time, do:
  $ '''./kim_2_digikam &lt;rootfolder&gt;'''
    it will create the digikam.db database used by digikam (&gt;= 0.7 and &lt; 0.8 )


    Launch kimdaba, do some changes, relaunch the script
<!--T:22-->
  $ '''./kim_2_digikam &lt;rootfolder&gt;'''
The first time, do:
    it will update the digikam.db database
{{Input|1=$ ./kim_2_digikam <rootfolder>}}which will create the digikam.db database used by [[Special:myLanguage/Digikam|digiKam]] (>= 0.7 and < 0.8 )
    (you have to restart digikam to see the changes, though)


    Add some categories in Digikam to some pictures
<!--T:23-->
    and relaunch the script
Launch KPhotoAlbum, do some changes, relaunch the script
  $ '''./kim_2_digikam &lt;rootfolder&gt;'''
{{Input|1=$ ./kim_2_digikam <rootfolder>}}which will update the digikam.db database (you have to restart [[Special:myLanguage/Digikam|digiKam]] to see the changes, though).
    Then you can import the modifications you made with Digikam
    by doing in Kimdaba:
    '''File -&gt; import: /tmp/digikam_export.kim'''


The good thing with synchronizing with digikam.db
<!--T:24-->
is that you can then use the &quot;&#039;&#039;digikamtags:/&#039;&#039;&quot; KIOSlave
Add some categories in digiKam to some pictures and relaunch the script
to browse by Persons/Keywords/Locations in every KDE app.
{{Input|1=$ ./kim_2_digikam <rootfolder> }}Then you can import the modifications you made with [[Special:myLanguage/Digikam|digiKam]] by doing in KPhotoAlbum:  <menuchoice>File -> Import: /tmp/digikam_export.kim</menuchoice>
(And add a tab &quot;Kimdaba&quot; =&gt; url=digikamtags:/ in Konqueror sidebar
for example).


== JAlbum gallery export ==
<!--T:25-->
The good thing with synchronizing with digikam.db is that you can then use the ''digikamtags:/'' KIOSlave to browse by Persons or Keywords or Locations in every KDE app. (And add a tab "KPhotoAlbum" -> url=digikamtags:/ in [[Special:myLanguage/Konqueror|Konqueror]] sidebar for example).


If you really like the [http://jalbum.net/samples.jsp many beautiful ways] that [http://jalbum.net JAlbum] will let you display the images, but you are not willing to abandon KPhotoAlbum, use this script to duct tape your Kimdaba&#039;s comments to JAlbum.
== JAlbum gallery export == <!--T:26-->


* Download kim_jalbum.pl from http://thread.gmane.org/gmane.comp.kde.kimdaba/919 here] , and do:
<!--T:27-->
  $ '''./kim_jalbum.pl &lt;rootfolder&gt;'''
If you really like the [http://jalbum.net/samples.jsp many beautiful ways] that [http://jalbum.net JAlbum] will let you display the images, but you are not willing to abandon '''KPhotoAlbum''', use this script to duct tape your KPhotoAlbum's comments to '''JAlbum'''.


<!--T:28-->
* Download '''kim_jalbum.pl''' from [http://thread.gmane.org/gmane.comp.kde.kimdaba/919 here] , and do:
{{Input|1=$ ./kim_jalbum.pl <rootfolder> }}
<!--T:29-->
Then  [http://jalbum.net/install.htm download JAlbum] and install it (Java required). You need to do some setup first:
Then  [http://jalbum.net/install.htm download JAlbum] and install it (Java required). You need to do some setup first:


::* Tab main:
<!--T:30-->
Image directory: Kimdaba&#039;s root folder
* Tab main:
Output directory: Your album folder
: Image directory: KPhotoAlbum's root folder
: Output directory: Your album folder


::* Tab advanced:
<!--T:31-->
Ignore pattern: \..*|ThumbNails|CategoryImages|index.xml
* Tab advanced:
: Ignore pattern: \..*|ThumbNails|CategoryImages|index.xml


::* Menu File -&gt; Save as default
<!--T:32-->
* Menu File -> Save as default


JAlbum only allows you to make a gallery from one folder (and his subfolders) while
<!--T:33-->
KPhotoAlbum has nowhere this restriction.  Here is a solution:
'''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''
<!--T:34-->
''In KPhotoAlbum''


::* Eventually delete the &#039;jalbum&#039; keyword to restart from scratch.
<!--T:35-->
* Eventually delete the "jalbum" keyword to restart from scratch.


::* Set the &#039;jalbum&#039; keyword for each pictures you want to export.
<!--T:36-->
* Set the "jalbum" keyword for each pictures you want to export.


::* Save your changes
<!--T:37-->
* Save your changes


<!--T:38-->
''In Konsole''
''In Konsole''


<!--T:39-->
Create a directory with symlinks to your tagged pictures :
Create a directory with symlinks to your tagged pictures :
  $ '''kim_jalbum.pl ~/Images --exportdir ~/Syms/patou/'''
{{Input|1=$ kim_jalbum.pl ~/Images --exportdir ~/Syms/patou/}}
 
<!--T:40-->
That's it, now use ''~/Syms/patou/'' as Image Directory
 
==Auto-assign categoryimages == <!--T:41-->


That&#039;s it, now use ''~/Syms/patou/'' as Image Directory
<!--T:42-->
In KPhotoAlbum'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 -> <menuchoice>Show category editor</menuchoice>, but it's a bit long if you have 500 persons. So this script will choose it for you.


==Auto-assign categoryimages ==
<!--T:43-->
In Kimdaba&#039;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 -&gt; Show category editor'', but it&#039;s a bit long if you have 500 persons. So this script will choose it for you.
{{Input|1=$ mkdir -p &lt;rootfolder&gt;/CategoryImages
$ ./kim_category_images  <rootfolder>}}


  $ '''mkdir -p &lt;rootfolder&gt;/CategoryImages'''
<!--T:44-->
  $ '''./kim_category_images  &lt;rootfolder&gt;'''
It's faster than to set the 500 pictures by hand, isn't it?
It&#039;s faster than to set the 500 pictures by hand, isn&#039;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.
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 ==
== Really rotate your pictures == <!--T:45-->
In KPhotoAlbum, you can rotate pictures, but the pictures will not be really rotated, the rotation will only be stores in the index.xml database. To improve interoperability with other software, it&#039;s useful to really rotate. Quit Kimdaba and use this script ''(you need the '''jpegtran''' tool)''
 
<!--T:46-->
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 KPhotoAlbum and use this script ''(you need the '''jpegtran''' tool)''
 
<!--T:47-->
{{Input|1=$ ./kim_rotate.pl <rootfolder> }}


$ '''./kim_rotate.pl &lt;rootfolder&gt;'''


== Export a hierarchy of symbolic links == <!--T:48-->


== Export a hierarchy of symbolic links ==
<!--T:49-->
(a bit proof-of-concept for Kimdaba.pm, but could be useful when using non kde apps (see kim_2_digikam ))
(This is a bit proof-of-concept for Kimdaba.pm, but could be useful when using non kde apps (see kim_2_digikam ))


<!--T:50-->
Edit the first line of the script, then
Edit the first line of the script, then
  $ '''./kim_2_filesystem &lt;rootfolder&gt;'''
{{Input|1=$ ./kim_2_filesystem <rootfolder> }}
 
== Write your own == <!--T:51-->
 
<!--T:52-->
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 [http://search.cpan.org/~jmfayard/Image-Kimdaba/lib/Image/Kimdaba.pm Write your own extension] , it's very easy.
 
<!--T:53-->
If you feel the need, you can share your script with other people by editing this page and sending an email to the [http://www.kphotoalbum.org/index.php?page=communication-media KPhotoAlbum mailing-list].


== Write your own ==
<!--T:54-->
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 [http://search.cpan.org/~jmfayard/Image-Kimdaba/lib/Image/Kimdaba.pm Write your own extension] , it&#039;s very easy.
[[Category:Graphics]]
If you feel the need, you can share your script with other people by editing this page and sending an email to the [[KPhotoAlbum]]&#039;s [http://ktown.kde.org/kimdaba/misc.htm mailing-list].
[[Category:Advanced Users]]
</translate>

Latest revision as of 12:55, 21 November 2010

General Description

Image::Kimdaba is a Perl module available on CPAN for parsing the KPhotoAlbum database

Installation

Here we will assume that you want to install the module as a user, say in $HOME/local;

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

Answer a bunch of question the first time. At some point, you have to enter:

PREFIX=~/local

Then, in the CPAN shell, type

> install Image::Kimdaba

You need to modify two environment variables (change the version number accordingly):

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

If everything is OK, it's now time to test if it works. Launch KPhotoAlbum's demo (in the Help menu) and run:

$ kim_example.pl  /tmp/kphotoalbum-demo-$USER


Upgrade

Thanks to the CPAN infrastructure, you only need to type:

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

Installation on Debian

On Debian it's possible to automagically install Image::Kimdaba . Install first dh-make-perl, and then (as root) :

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

Scripts coming with Image::Kimdaba

Note

The README file on CPAN may be more up to date.


Here we describe scripts already made that you may find useful.

Synchronize comments between KPhotoAlbum and digiKam

The first time, do:

$ ./kim_2_digikam <rootfolder>

which will create the digikam.db database used by digiKam (>= 0.7 and < 0.8 )

Launch KPhotoAlbum, do some changes, relaunch the script

$ ./kim_2_digikam <rootfolder>

which will update the digikam.db database (you have to restart digiKam to see the changes, though).

Add some categories in digiKam to some pictures and relaunch the script

$ ./kim_2_digikam <rootfolder>

Then you can import the modifications you made with digiKam by doing in KPhotoAlbum: File -> Import: /tmp/digikam_export.kim

The good thing with synchronizing with digikam.db is that you can then use the digikamtags:/ KIOSlave to browse by Persons or Keywords or Locations in every KDE app. (And add a tab "KPhotoAlbum" -> url=digikamtags:/ in Konqueror sidebar for example).

JAlbum gallery export

If you really like the many beautiful ways that JAlbum will let you display the images, but you are not willing to abandon KPhotoAlbum, use this script to duct tape your KPhotoAlbum's comments to JAlbum.

  • Download kim_jalbum.pl from here , and do:
$ ./kim_jalbum.pl <rootfolder>

Then download JAlbum and install it (Java required). You need to do some setup first:

  • Tab main:
Image directory: KPhotoAlbum's root folder
Output directory: Your album folder
  • Tab advanced:
Ignore 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 KPhotoAlbum

  • 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 KPhotoAlbum'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 KPhotoAlbum 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.