Archive for December, 2013

gdk-pixbuf-csource: could not recognize image file format for stock_attach.png

December 16th, 2013 -- Posted in Tech | 3 Comments »

When compiling libgnomeui, I ran into a particularly persistant error. Namely “Could not recognize image file format for ./stock_attach.png”

With my system being a very slimmed down slackware 14.0, first thing I checked was the presence of libpng, which was neatly installed. With a little help from google I discovered that this error usually meant an empty /etc/gtk-2.0/gdk-pixbuf.loaders file.

It was not empty in my case, but to be sure I generated a new one with gdk-pixbuf-query-loaders (don’t forget to add -64 if you’re on a strictly 64 bit system). Needless to say it did not make a difference.

After a bit of digging I discovered the ‘gdk-pixbuf-csource’ command to be the culprit. I had it execute on different file formats, jpg, gif, all things clearly present in the gdk-pixbuf.loaders file. Same error over and over again.

Looking at the gdk-pixbuf.loaders file I noticed the recognition pattern was formatted like a mime type. Now it started dawning on me. I did not have any libraries present which handled mime data.

And yes, after installing gmime and shared-mime-info, gdk-pixbuf-csource correctly identified image file types and libgnomeui compiled without further errors.

The only way you’d run into this problem is if you were stupid enough to prune even the most basic packages from your slackware install, but if you do, I hope this helped.