GNOME Bugzilla – Bug 570780
GdkPixbufLoader fails to auto-detect PPM
Last modified: 2010-07-10 04:09:35 UTC
The attached program fails with gdk-pixbuf 2.14.3 and all newer versions (including current trunk). The call to close() errors out with the message "Unrecognized image file format". The program works fine with 2.12.11 and any older versions. The program works fine with all versions of gdk-pixbuf when the call to gdk_pixbuf_loader_new is replaced with gdk_pixbuf_loader_new_with_type ("pnm", &error);
Created attachment 128090 [details] Test program
Created attachment 128091 [details] Failing test program I accidentally attached the variant of the test that works with every version.
The test program works fine for me. But I have an idea about what causes the problem. GDK-pixbuf is now using GIO for sniffing the type of file instead of using the magic pattern supplied by the loader (io-pnm.c in this case). GIO in turn relies on the mime database from freedesktop. Perhaps you have an old mime database which lacks the magic patterns for ppm?
I see. The test program does indeed work fine with the system-installed gdk-pixbuf 2.14.4. So apparently there's something wrong with my test sandboxes. (I do have shared-mime-info installed, and <prefix>/share/mime/packages/freedesktop.org.xml does list the P6 pattern for PPM.) Anyway, it's not a gdk-pixbuf bug.