[Scribus] Back with perl and scribalbum.pl

Mikolaj Machowski mikmach
Tue Sep 14 01:00:24 CEST 2004


Dnia poniedzia?ek, 13 wrze?nia 2004 05:28, Gregory Pittman napisa?:
> Well, like it or not, I've created a perl program that will take a
> directory full of image files and create and Scribus "album", so to
> speak.
>
> Eventually I want to use it as a cataloguing feature -- I've got so many
> directories with digital photos in them that I can't keep them straight.
> Here is my first attempt -- it works, and Scribus doesn't choke on the
> files.
> Later I want to add text frames with the filenames beside the picture --
> one could right-click on Info to get the name in Scribus of course.
> Also am thinking about automatically adding blank text frames for
> annotating with Story Editor later, if desired -- could do this
> manually, of course, but when you're talking about hundreds of
> pictures....

As for cataloguing images you should look into specialized apps like
Digikam - http://digikam.sf.net

In CVS version - future 0.7 (betas should rollout in few days) - it use
sqlite to store info, comments, tags about pictures in database. With
command line tool you can access info about them. So, I created
cdigi, shell script for generating HTML galleries:

http://www.kde-apps.org/content/show.php?content=15103
(links to examples are also there)
Detailed manual is:
http://skawina.eu.org/mikolaj/README.html

With this script you can query database for album name, various tag
queries or even full SQL query.

This script can also just print file names. Just make your script to
accept list of files as arguments and call:

scribalbum.pl `cdigi <query according to man cdigi> --print`

Or implement this directly in Perl. Cdigi heavily relies on ImageMagick
programs where Perl has more direct access to that functionality.

Alas, cdigi currently does not return comments to files (only in HTML
creation mode, check examples please). I have this on my to-do list.
BTW if you use cdigi to retrieve that info, what format of reporting
would you like to easy processing information?

I was thinking about:
cdigi <query> --report
** Album: <query> **
-- file --
filename
-- comment --
comment
-- file --
-- file --
filename
-- comment --
comment
-- file --
** Album: <query> **
-- file --
filename
-- comment --
comment
-- file --

(comment can be formatted so its good thing to explicitly separate it)

With such thing you could make
scribalbum.pl `cdigi <query> --report`

And detect if output contain some keywords.
Or I can create special --scribalbum switch to provide output just for
you. This is probably the best solution - separate digikam and scribus
specific stuff.

I am writing so long because from the beginning I was thinking about
something like sdigi - the same as cdigi but with .sla instead of .html
output. But I think there is no sense to duplicate efforts.


[cut]
> Is this a bug?  -- While I was analyzing the Scribus file format, I
> noticed that the image filenames are relative paths, not absolute; this
> means that if you copy a Scribus file using cp, for example, to another
> directory, Scribus won't be able to find the images (found out this was
> indeed true).  Seems like they ought to be absolute paths.
>
But you can easily move whole projects (sla files, text and images).

m.

ps. Your script probably can be hosted on kde-apps.org .

-- 
LaTeX + Vim = http://vim-latex.sourceforge.net/
Vim Universal Templates 
	http://www.vim.org/scripts/script.php?script_id=1078
CLEWN - http://clewn.sf.net






More information about the scribus mailing list