Bugs item #2561765, was opened at 2009-02-03 14:26
Message generated for change (Comment added) made by mcfletch
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105988&aid=2561765&group_id=5988
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Andrew Straw (astraw)
Assigned to: Nobody/Anonymous (nobody)
Summary: Wrong image size for glReadPixels()
Initial Comment:
I've been tracking down an error with the Vision Egg and PyOpenGL 3. (This code works fine with PyOpenGL 2.) The code that led me to this issue is line 476 of VisionEgg/Core.py [1], which is a call to glReadPixels(). Basically, doing glReadPixels with a format of GL_BGRA and type of GL_UNSIGNED_INT_8_8_8_8_REV returns an NxMx4 array of type uint32. I think this should either be an NxM(x1) array of type uint32 or an NxMx4 array of type uint8.
The code at issue seems to be in OpenGL.images.createTargetArray(). It is responsible for creating the mis-sized array. I hesitate to suggest a patch, since I'm not sure what the optimal solution is, but this is at least a change of behavior since PyOpenGL 2.
I am including a test which hopefully clarifies my thinking about the proper size of the array.
[1] http://visionegg.org/trac/browser/tags/release_1.1.2/VisionEgg/Core.py#L476
----------------------------------------------------------------------
>Comment By: Mike C. Fletcher (mcfletch)
Date: 2009-07-18 20:08
Message:
Hi Andrew, thanks for the bug report, and particularly for the test case.
I've added a table to the OpenGL.images module which enumerates the packed
image types and overrides the calculation for their case, as well as
checking that the format can hold the number of components specified (at
least). bzr head has the fix.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105988&aid=2561765&group_id=5988
|