How to determin bit depth of a Gtk::Image?



Hi all,

I'm trying to got the bit depth (typically 8, 16, 24 or 32) of a
Gtk::Image.
Gdk::Pixbuf::get_bits_per_sample() seems to be what I'm looking for
but it always returns 8. Others get methods work perfectly well.
I also tried with Gdk::Drawable::get_depth() after getting the pixmap
with Gtk::Image::get_pixmap. Unfortunately get_pixmap works only
for empty and pixmap image.

Here is the code:

m_Image.set(filename);

Glib::RefPtr<Gdk::Pixbuf> pixbuf = m_Image.get_pixbuf();

std::cout << "bits per sample " << pixbuf->get_bits_per_sample() <<
std::endl;

Any help appreciated.

Thank's

.