Pictures blob in Gnome-DB

Just before christmas I finished implementing the “picture” plugin for Gnome-DB. It allows to display BLOB (binary objects in databases) and encoded strings as pictures for all the picture types gdk-pixbuf knows about.

Here is a screenshot of that plugin in action in a form and in a grid:

5 thoughts on “Pictures blob in Gnome-DB”

  1. Excellent. That’s more code that I could remove from Glom one day. How are you identifying the image type though? In Glom, I just convert everything to PNG and assume that it’s PNG when I read it pack.

  2. The file format is recognized automatically, so it will display correctly as long as gdk-pixbuf knows that file format.

  3. These widgets are bound to a database aren’t they? It would be much nicer if they were reusable outside of that. For instance, in MS.Net, things like the GridView that display paged row/column data are not bound to using a database. They use an IEnumerable, an interface that lets you enumerate over a result set. The data sets retrieved from the database implement this, but also, you can write your own data providers to expose the interface.

    So, you can use ORM tools, for instance. I’d be nice to have these widgets work like that.

  4. Vivien, Ah, I see you are storing a serialization of the GdkPixdata structure, which includes information about the format. So you couldn’t, for instance, write the data directly out to a file and expect to be able to view it as a picture. That’s fine though. I didn’t know that API existed.

  5. In reply to Jerry Haltom:

    In fact the widgets display any data contained in a GdaDataModel
    object. The GdaDataModel is an interface defined in libgda which of
    course contains an object using SQL methods which implements taht
    interface , but there are also other objects which also implement that
    interface and which are not related in any way to SQL (for example
    loading a CSV file).

Comments are closed.