From: Nicholas P. <nic...@ni...> - 2007-07-03 10:37:12
|
Todd, On Mon, 02 Jul 2007, Todd Zullinger wrote: > Nicholas Piper wrote: > > My autofoo is just failing me, after a long time of trying today. > I think the issue causing configure to fail was due to lack of the gtk > cflags and linker flags. The attached update to the patch in the > sf.net tracker hopefully fixes this. (It also means that to build the > python bindings gtk needs to be installed.) Personally, I'm happy with that dependency. > I removed the 'import gtk' from ipod.py, I don't think it was being > used. If it is needed, we ought to make the import conditional so it > doesn't require pygtk at runtime, else users who disabled it at > compile time will be annoyed with us still. :) That was required, but there might have been a cleaner way to do it... Without that, the pygobject 'magic' doesn't tie in all the GDK pixbuf methods with the pixbuf object that is returned from C to Python-space. Maybe I can do that init step somewhere else. > I also made the init_pygobject call in gpod.i.in conditional. If we're going to only build the python module if GTK is around, I'm sure we can depend fully on pygobject too. > > To test, make sure your iPod has some photos in an album, then I did > > this: > > $ LD_LIBRARY_PATH=../../../src/.libs PYTHONPATH=..:../.libs ./save_photos.py > <PhotoDatabase Mountpoint:'/media/IPOD' Albums:8 Photos:1599> > <PhotoAlbum Title:'Photo Library' Photos:1599 Type:1> > <Photo ID:64L Creation:'Sun 24 Dec 2006 10:25:14 PM ' Digitized:'Wed 31 Dec 1969 07:00:00 PM ' Size:835386L> > <Thumbnail Filename:':Thumbs:F1036_1.ithmb' Size:4100 Width:40 Height:41> > swig/python detected a memory leak of type 'gpointer *', no destructor found. > Traceback (most recent call last): > File "./save_photos.py", line 38, in <module> > thumbnail.get_pixbuf().save("/tmp/%d-%d.png" % (photo['id'],n),"png") > AttributeError: 'PySwigObject' object has no attribute 'save' > > I could be doing something wrong, but I'm not sure what that is. Any > ideas? It looks like the swig run didn't include this part: #ifdef HAVE_GDKPIXBUF #ifdef HAVE_PYGOBJECT %typemap(out) gpointer itdb_thumb_get_gdk_pixbuf { $result = pygobject_new((GObject *)$1); g_object_unref($1); } %typemap(in) gpointer pixbuf { $1 = GDK_PIXBUF(pygobject_get($input)); } #endif #endif so one of those ifdef's failed? Nick -- Nick Piper, Developer, LogicaCMG http://www.nickpiper.co.uk/ GPG Encrypted mail welcome! 1024D/3ED8B27F Choose life. Be Vegan :-) Please reduce needless cruelty & suffering ! |