Image Kimdaba/uk: Difference between revisions

From KDE Wiki Sandbox
(Created page with "{{Input|1=$ mkdir -p <коренева тека>/CategoryImages $ ./kim_category_images <коренева тека>}}")
Line 99: Line 99:
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 -> <menuchoice>Show category editor</menuchoice>, but it's a bit long if you have 500 persons. So this script will choose it for you.
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 -> <menuchoice>Show category editor</menuchoice>, but it'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
{{Input|1=$ mkdir -p &lt;коренева тека&gt;/CategoryImages
$ ./kim_category_images  <rootfolder>}}
$ ./kim_category_images  <коренева тека>}}


It's faster than to set the 500 pictures by hand, isn't it?
It's faster than to set the 500 pictures by hand, isn't it?

Revision as of 18:11, 12 October 2010

Other languages:

Загальний опис

Image::Kimdaba — модуль мовою Perl, що зберігається у сховищі CPAN. Модуль призначено для обробки бази даних KPhotoAlbum.

Встановлення

Тут ми припускатимемо, що ви хочете встановити модуль для певного користувача, скажімо у $HOME/local.

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

Спочатку вам слід буде відповісти на декілька питань. На одному з кроків вкажіть каталог:

PREFIX=~/local

Потім у оболонці керування CPAN віддайте таку команду:

> install Image::Kimdaba

Вам доведеться змінити значення двох змінних середовища:

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

Якщо не було показано ніяких повідомлень про помилки, час перевірити скрипт у дії. Запустіть демонстрацію Kimdaba (за допомогою меню Довідка) і введіть команду:

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


Оновлення

Завдяки інфраструктурі CPAN, вам достатньо ввести:

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

Встановлення у Debian

У Debian можна встановити Image::Kimdaba у автоматичному режимі. Спочатку встановіть dh-make-perl, а потім віддайте від імені користувача root команду:

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

Скрипти, що є частиною 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 Kimdaba 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 kimdaba, 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 Kimdaba: 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 "Kimdaba" -> 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 Kimdaba's comments to JAlbum.

$ ./kim_jalbum.pl <rootfolder>

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

  • Tab main:
Image directory: Kimdaba'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 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 <коренева тека>/CategoryImages
$ ./kim_category_images  <коренева тека>

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.