On 27/03/2011 21:13, Antoine Martin wrote:
> I am using the "PyGTK All-in-one Installer 2.22.6" and it works
> beautifully (thank you for making my life easier!) but when I bundle my
> application with py2exe the "jpeg" loader is no longer found.
> 
> At first I thought that I just needed to run gdk-pixbuf-query-loaders to
> generate a new loaders config before bundling, but as I explored I found
> no trace of the jpeg loader DLL and the resulting loaders config makes
> no mention of jpeg (the config from the installer doesn't either).
> In previous builds there was a "libpixbufloader-jpeg.dll", I guess this
> is now built-in somehow? Why isn't it found once bundled then?

GTK+ windows binaries have been using GDI+ to load most image formats
for some time now. That explains why we no longer have separate loader
dll's except for svg. Does your target bin directory contain
libgdk_pixbuf-2.0-0.dll?

> I thought it might need to be on the PATH or PYTHONPATH, so I tried
> setting those variables before running my application EXE but this did
> not help either (but this could just be py2exe overriding the environment)

Be careful with PATH, doing so does not always behave as you would
expect (it's always a good idea to verify with Dependency Walker what
libraries are loaded and if those correspond with what you intended).

> PS: the code:
> loader = gtk.gdk.PixbufLoader("jpeg")
> loader.write(img_data, len(img_data))
> pixbuf = loader.get_pixbuf()
> loader.close()

I'll try py2exe'ing the above tomorrow morning...

> The strange thing is that it does not error out, pixbuf is just set to None.

That might be expected behavior, but then again I have not yet
studied the gdi+ loader code used by gdk...

mvg,
Dieter
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to