Problems making loaders for header-less images

I've made a couple of gdk-pixbuf loaders for formats that cannot be
finger printed using a pattern, because they totaly lack some kind of
header or that information is located at the end of the file. This
has causes me the following problems:

* If one loader handles several (similar) formats that cannot be
  distinguished from each other by looking at the first bytes. Then
  gdk-pixbuf uses other means to distinguish between them (extension or
  mime-type) but the information about what the match was based on is
  unavailable to loader (or am I missing something). Can this be solved
  is some way (except by making a different loader for each variant)?

  There is an image format called pi1 (the most common format on the
  Atari ST). It consists of one word telling about the resolution, the
  palette and a copy of the screen memory. A variant of the format is
  called pc1 and has the only difference that the screen memory image
  is compressed. It is easy to distinguish between them using the
  extension or by looking at the file size (pi1 has a fixed size of
  32066 bytes while pc1 is always smaller).

* If a loader doesn't provide any fingerprinting pattern gdk-pixbuf
  causes a segfault at runtime then trying to load a picture in any
  format. Is the loader required to provide at least one pattern or is
  this a bug?

* If the only thing that is known about the format is that it starts
  with one or more zeros, then gdk-pixbuf-query-loaders will refuse to
  register the loader because it considers the pattern to be empty.
  This could be avoided to checking the length of the mask field
  instead to the prefix field. A bug?

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