2008/6/1 Brian Matherly <brian@gramps-project.org>:
> > 3/as Eero says, gkd methods can be used to create new files. Probably
> > calling ImageMagick (http://www.imagemagick.org/script/index.php )
> would
> > be much faster, but means relying on an external program (imagemagick
> is
> > installed everywhere in linux though...).
>
> I think I like the idea of using ImageMagick more, cropping requires
> then
> just calling ImageMagick with the required are co-ordinates and size
> like
> this:
> convert -crop <width>x<height>+<x>+<y> <image> <cropped image>

I can't understand why ImageMagick would be faster or better than the gdk
methods.

> > Generally, should this be an option, or should GRAMPS just do it like
> > this? I would think it is not needed as an option and should be
> default
> > behavior.
>
> I wouldn't mind a dependency to ImageMagick, it can do also other kinds
> of other cool tricks like adding a frame to the image, converting them
> to
> grayscale[1], scaling them etc.   All this in a single "convert"
> command
> call.

Personally, I would rather see us reduce the number of dependencies Gramps
has on other programs if at all possible. I know ImageMagick is quite common
on Linux systems, but on Windows it would almost certainly not be installed.

I was thinking in the way of, if convert of Imagemagick is present, then offer the option/just do it, otherwise not. I know it is fast and good, I don't know how the gdk manipulation methods fare, nor how they handle png/jpg/bmp/.... . The other big advantage I was seeing was the fact that we could do it in other processes, so the web generation can continue without waiting.
Obviously, we can make a convert.py, and run that as a separate program too to do the region clipping, with same advantage of not waiting for the conversion to finish.

The idea would then be: we have pic.jpg, with handle MOCIR5KCQXECKHKZNI, so this is in images/M/O/MOCIR5KCQXECKHKZNI.JPG, and we generate images/M/O/MOCIR5KCQXECKHKZNI_A__B.JPG for every region AxB that is needed. If already exiting, then don't regenerate (important as this is in a media reference, so same region can appear multiple times, we don't need multiple pictures).

Benny


~Brian