Independent image loaders in gdk-pixbuf

Owen asked me to post some information regarding bug 77486 here...

The bug is about making gdk-pixbuf loaders separately installable. 
This is a necessary prerequisite for an svg loader. At least for one
using librsvg, since librsvg depends itself on gdk-pixbuf, thus
bundling the loader with gdk-pixbuf would lead to devious cyclic build

In order to allow independent loader development, the gdk-pixbuf SPI
for image modules must be made public. It consists of 
gdk-pixbuf-io.h and gdk-pixbuf-animation.h (the latter is necessary to 
allow independent animation loaders). Since these interfaces can not
be guaranteed to be 100% stable (in fact, the collection stuff which I
talked about last week had to do some changes to the image module
SPI), it will be protected by #ifdef GDK_PIXBUF_ENABLE_BACKEND (like 
e.g. the Pango backend interface) and the GdkPixbufModule class will
get some padding.

Here is a broad outline of the patch attached to bug 77486:
There are no longer format-specific functions pixbuf_check_xyz inside
libgdkpixbuf. Instead, libgdkpixbuf contains a single parameterized
pixbuf_check_format function. The map from match patterns to
corresponding image loader object is read from a text file,
gdk-pixbuf.loaders. This is created by an auxiliary program,
gdk-pixbuf-query-loaders, which queries all installed loaders for the
necessary information. To enable this, GdkPixbufModule has acquired
two new functions, get_name() and get_signature().
As a side-effect of this approach, the GDK_PIXBUF_MODULEDIR
environment variable is now only read by gdk-pixbuf-query-loaders;
gdk-pixbuf itself inspects a new environment variable
GDK_PIXBUF_MODULE_FILE, which can be used to override the default
location of the gdk-pixbuf.loaders file (e.g. for uninstalled
operation of the pixbuf demos in gtk).

In order to demonstrate the usefulness of independent loaders, the
patch also includes an svg loader based on librsvg. As mentioned
above, this can't be included in gdk-pixbuf. 

Perhaps it could find a home in librsvg ?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]