During the discussion of mandarory or optional PNG support I've
started wondering if we *really* need a multitude of different
image format support in the core and the modules.

At the moment, there's a plugin like image loading and maintenance
layer in the library that takes care or reading images into
memory.  When this is done, all images are actually the same.

  +-----------+   +-----------+   +-----------+
  | PNG file  |   | XPM file  |   | SVG file  |
  +-----------+   +-----------+   +-----------+
        |_______________|_______________|
                        |
                        | load
                        |
  +-------------------------------------------+
  | | PNG lib   | | XPM lib   | | SVG lib   | |
  | +-----------+ +-----------+ +-----------+ |
  |       |_____________|_____________|       |
  |                     |                     |
  |       +---------------------------+       |    ^
  |       | Picture code using Pixmap |       |    |
  |       +---------------------------+       | library code
  |---------------------|---------------------|
  |                     |                     |
  |    fvwm core or module using Pixmaps      |
  |                                           |
  +-------------------------------------------+

It would be possible to rip out image loading support from the
library except for a single format and rely on external tools to
provide that format if necessary.  Possible approaches:

 * Use e.g. Imagemagick to convert the image file to the target
   format.  We'd get support for many image formats for free
   while linking fvwm with only one image library.

 * Have our own tool similar to fvwm-root to read the image into
   memory (on the X server, as shared memory or whatever).  Only
   that tool would know about image formats,  Fvwm and the modules
   would simply work with the Pixmaps from memory.  As a bonus,
   the Pixmaps could be shared between modules and the core.

The Imagemagick approach is probably too slow and unreliable, but
the second should be doable with well designed inter process
communication (which needs a redesign anyway).  Uploading Pixmaps
to the server before they can be used may not be a good idea for
remote servers.

Thoughts?

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt

Reply via email to