Source

pygame / test / interop_pil.py

Diff from to

test/interop_pil.py

         image = original_image.rotate(angle)
         image_width, image_height = image.size
 
-        # Caution: keep the ctypes array ("data") as a local var during
-        # blitting, otherwise the pixel data will be free'd early
-        #s = image.tostring()
-        #sb = create_string_buffer(s)
-        #data = cast(sb, POINTER(c_ubyte*len(s))).contents
-        #data = SDL.array.to_ctypes(s, len(s), c_ubyte)
-
-        # This alternative also works
-        #s = [c[0] | (c[1] << 8) | (c[2] << 16) for c in image.getdata()]
-        #data = SDL.array.to_ctypes(s, len(s), c_uint)
-
         surface = SDL_CreateRGBSurfaceFrom(image.tostring(),
             image_width, image_height, 32, image_width * 4,
             0x000000ff,