Re: Minutes: Foreign OSes BoF

Hi Tor,

In order for that to happen, someone would need to re-design (at
minimum) GdkPixbuf's module and loader interfaces and use Windows
Vista or newer. Some notable problems are:

* The loader's "create by type" function uses the module's name (i.e.
"gdi+" or "png"), rather than a mime-type. Lots of programs assume a
1:1 relationship (eg. "give me the 'wmf' loader").
* The savers have a similar deficiency. You can't say "save as this
mime type". You have to say "use the 'png' module to save this". The
format is implied by the module's name.
* Along with that, there's the assumption that a module may load many
formats, but there's no corresponding way for it to save to multiple
formats as GDI+ can do.
* The query-loaders mechanism requires that the supported formats be
known ahead of time

But enough about GdkPixbuf's deficiencies, because GDI+ has its share too:

* There is no way that I know of to distinguish between a
metafile/vector format and a raster format, except maybe to try
loading everything as a metafile and see if something fails. You can't
get a GpMetafile's pixels, even if you "load" it as a GpBitmap. The
work-around is to draw it to a GpGraphics object backed by a bitmap,
but you probably don't want to do that for something that is already a
bitmap. It's wasteful of CPU cycles and RAM. But that's overshadowed
by the bigger problem of:
* The functions that enumerate GDI+'s loaders simply don't exist in
the 1.0 version of the GDI+ DLL. They may exist in the 1.1 DLL (which
is not re-distributable AFAIK), but that's only in Windows Vista, and
we know how great Vista adoption is going.

That's just off the top of my head.

Best regards,

On Mon, Mar 17, 2008 at 8:55 PM, Tor Lillqvist <tml iki fi> wrote:
> While hacking on integrating the GDI+ loader into the GTK+ tree I
>  started wondering: If we build the GDI+ loader into the gdk-pixbuf DLL
>  (instead of having it as a separate DLL), then it should be possible
>  to determine the supported formats at run-time, right? (And thus
>  automatically get support for whatever new formats are added to GDI+,
>  or have been added on the machine by installing some extension or
>  plug-in to GDI+.)
>  Presumably the GDI+ loader would then have to appear to gdk-pixbuf as
>  two separate loaders, one for the read-only formats, and one for the
>  read-write ones, even if both are implemented in the same source
>  file(s).
>  --tml

Counting bodies like sheep to the rhythm of the war drums.

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