On Mon, 23 Jul 2001, Dekel Tsur wrote:
> There are several problem with the preview code in graphics inset:
>
> 1) It doesn't work. I get "Need converter from eps to xpm" message.
> Even if I define such a converter, it doesn't work.
I think there should be such converters defined automatically, I belive I
commited my code to update the libs/configure, will recheck when I get
back home.
I'm using ImageMagick and it worked, will test it.
> 2) I really don't like the idea to use convert to create an xpm file.
> Why not use pipes ? (namely run 'convert <graphics-file> xpm:-' )
Basically because I use XpmReadFileToPixmap to get the XPixmap, I don't
know how to make it load the data from the pipe. I can probably create a
pipe "file" and use that but I've never done such things, a guiding hand
or a reference example would help.
We had the discussion a long time ago, there is no real reason to avoid it
when you use a dumb image loader like XForms have, too much trouble. I
intend to add additional loaders that will use better graphical libraries
(like gdk-pixbuf or imlib2) and these will do most of this on their own.
The reason for not doing it right now is to support those users who cannot
install a good supporting library. The simplest route could be to require
everyone to install gdk-pixbuf (and thus gdk and glib) and have the image
library do it all for us, resizing, rotationg, dithering and all in the
background.
> 3) The image conversions should be done in thread, so it won't affect the
> time for opening a document.
I want to do it this way, but it is not so trivial, the execution code in
support doesnt work asynchronously, and I'm not sure if Converter can be
used in a thread.
We have no protection on the data structures from several changes. Can I
be sure that the Converter data structures are read-only when I load the
document?
I believe I asked Lars about this at the time, can we add dependency on
libpthread? This will solve my problem by adding mutexes and using
threads. Otherwise I'll need to get back to my asynchronous process
running code that I started work on and abandoned when the complexity
soared.
A partial solution could be to have two code paths for when there is
libpthread and for thwne there isn't but this is a maintenance nightmare.
Baruch