Traceback (most recent call last): File "ac_bug.py", line 6, in <module> ac = py.numpyarray.array_colorkey(s) # Raises exceptionFile "C:\PRG\PYTHON25\lib\site-packages\pygame\numpyarray.py", line 312, in ar
ray_colorkey array = numpy.choose (numpy.equal (array, colorkey), (0xff, 0)) ValueError: shape mismatch: objects cannot be broadcast to a single shapeThe code is also inefficient, not making proper use to numpy's type system. Using (numpy.uint8(0xff), numpy.uint8(0)) as the second argument to choose returns an array of uint8.
Lenard Lindstrom wrote:
Lenard Lindstrom wrote:Lenard Lindstrom wrote:It's good to see. Unfortunately I have already found a bug in the numpyarray.py module, line 217. A 3d array can also handle 24 bit pixels. So the third element of the shape needs be calculated.I have another bug. Attached is a program which raises the following exception:Traceback (most recent call last): File "ac_bug.py", line 6, in <module> ac = py.numpyarray.array_colorkey(s) # Raises exceptionFile "C:\PRG\PYTHON25\lib\site-packages\pygame\numpyarray.py", line 309, in array_colorkey array = array2d (sf) NameError: global name 'sf' is not defined Just a guess, but sf probably should be surface.I made the change myself and found that array_colorkey breaks for a 24 bit pixel surface since it calls array2d, which definitely cannot handle 24 bit pixels.
-- Lenard Lindstrom <len-l@xxxxxxxxx>