[Python-talk] mat3d error

Labitt, Bruce labittb1 at tycoelectronics.com
Thu Sep 11 16:26:41 EDT 2008


Comments sprinkled below...

-----Original Message-----
From: Python [mailto:python at venix.com] 
Sent: Thursday, September 11, 2008 2:57 PM
To: Labitt, Bruce
Cc: python-talk at dlslug.org
Subject: RE: [Python-talk] mat3d error

On Thu, 2008-09-11 at 13:48 -0400, Labitt, Bruce wrote:
> Hmm, in this case it may be an error in someone else's code.

OK, I'm still suspicious of the code you're running even if it was
simply downloaded demo code.  You seem to have enough stuff working to
have gotten all the big pieces installed OK.

Having said that, using a mix of distro-installs, easy-install, and
manual package installs can create version issues.  Fedora packages PIL
as python-imaging and python-imaging-tk.  Could the PIL warnings about
Tcl/Tk libraries reflect not using both packages?

[Labitt, Bruce] Yes, it could.  I couldn't find a separate package
python-imaging-tk.  For that matter, I couldn't find python-imaging,
only PIL.

Isn't Tkinter handling the screen that lets you see and manipulate the
image?  Could tracking down the error within glReadPixels help with
diagnosing a mismatched version problem?  Is the demo mat3d.py in sync
with the pyOpenGL that you are running?  [Labitt, Bruce] Don't know. 
A type error sounds to me like
the function parameters changed so that the caller and callee are out of
step.

[Labitt, Bruce] All good questions.

I've got PyOpenGL installed and the line number 323 matches to my
images.py file.  Digging in a little, the call really seems to go on to
this code in raw/GL/__init__.py
# /usr/include/GL/gl.h 1528
glReadPixels = platform.createBaseFunction( 
	'glReadPixels', dll=platform.GL, resultType=None, 
	
argTypes=[GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,POINTER(GLvoid)],
	doc='glReadPixels( GLint(x), GLint(y), GLsizei(width),
GLsizei(height), GLenum(format), GLenum(type), POINTER(GLvoid)(pixels) )
-> None', 
	argNames=('x', 'y', 'width', 'height', 'format', 'type',
'pixels'),
)

So the third argument is supposed to be GLsizei (??)
constants.py has
GLsizei = _defineType( 'GLsizei', ctypes.c_int, int )

Could you add the line
	print "width is:", width
into the mat3d.py file to send some debugging info to the console?

[Labitt, Bruce] Sure.  Where in the file should I add that line?  before
or after line 645?

-- 
Lloyd Kvam
Venix Corp
DLSLUG/GNHLUG library
http://dlslug.org/library.html
http://www.librarything.com/catalog/dlslug
http://www.librarything.com/rsshtml/recent/dlslug
http://www.librarything.com/rss/recent/dlslug



More information about the Python-talk mailing list