Using gdk-pixbuf from mpkg

Ben Letham bletham at gmail.com
Sat Mar 12 15:52:34 PST 2016


Hi,

I'm trying to run a simple Gtk3 PyGObject app which includes an image (and
so uses gdk-pixbuf). When I install py35-gobject3 and gtk3 through port I
can run the app just fine using macports python.

I want to be able to distribute this to other computers without having to
install xcode and macports, so I used macports to build mpkg's for
py35-gobject3 and gtk3. When I install these mpkg's on a computer without
macports, it seems that gdk-pixbuf isn't being set up correctly.

Running the app (with the python3.5 that was installed) complains that the
gdk-pixbuf installation is broken, and indeed the file
/opt/local/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache isn't created at all. I
create this file by running
sudo gdk-pixbuf-query-loaders --update-cache
but then I get a new error:

Glib.Error: gdk-pixbuf-error-quark: Couldn't recognize the image file
format for file 'icon.png' (3)

The actual python file I am running is:

from gi.repository import Gtk
win = Gtk.Window()
win.connect("delete-event", Gtk.main_quit)
win.set_icon_from_file('icon.png')
win.show_all()
Gtk.main()


If I leave out the "win.set_icon_from_file('icon.png')" line, it works just
fine, it seems to be just gdk-pixbuf that isn't working.
This is osx 10.9, using the XQuartz terminal.
I tried separately installing an mpkg for just gdk-pixbuf2, but that didn't
change anything.

Is this something that I should expect to work? Any ideas on how to debug
this?

Thanks!
Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-users/attachments/20160312/0328389f/attachment.html>


More information about the macports-users mailing list