31 de mayo de 2011

Bug in Gtk-sharp 2.12.10 for Windows

If you are using the package gtk-sharp-2.12.10.win32.msi from Novell FTP in some Windows application with GTK#, probably you have realized that Gdk.Pixbuf is not able to load JPEG images. Actually, JPEG is not in the list of supported formats. This happens because the loader for JPEG images is not in the gdk-pixbuf.loaders file (C:\Program Files (x86)\GtkSharp\2.12\etc\gtk-2.0\gdk-pixbuf.loaders).

To fix this problem you have two options:

Solution 1. Add manually the lines for JPEG loader in the gdk-pixbuf.loaders file:

"C:/Program Files (x86)/GtkSharp/2.12/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-jpeg.dll"
"jpeg" 5 "gtk20" "The JPEG image format" "LGPL"
"image/jpeg" ""
"jpeg" "jpe" "jpg" ""
"\377\330" "" 100

and rename the file libjpeg7.dll from the bin folder to libjpeg-7.dll.

Solution 2. Rename the file libjpeg7.dll from the bin folder to libjpeg-7.dll and run this in a terminal:

cd C:\Program Files (x86)\GtkSharp\2.12\bin
gdk-pixbuf-query-loaders.exe > gdk-pixbuf.loaders

It will generate a new gdk-pixbuf.loaders file. After it, replace the old gdk-pixbuf.loaders in etc folder with this new one.

As you can guess, the problem is that somebody removed the hyphen in libjpeg-7.dll, so gdk-pixbuf-query-loaders.exe is not able to find it, and the loader is not added. It would be nice to have a new installer with this problem fixed.

pd: Esto no es spam ni me he vuelto loco, es por ayudar a todo aquel que haya tenido la misma pelea que he tenido yo junto a mis compañeras esta mañana.

1 comentario:

nam dijo...

Hola.Muchas gracias por tu post!!! Me ayudó a resolver el problema.Me cayó de puras hostias.