[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] BUG: transform.average_surfaces in 24 bit mode from pygame.image.load'd surfaces.



hi,

in 24 bit mode the average surfaces seems to swap the blue and the red
channels around.

This happens when loading some jpg files to average them.

Had a quick look... but I can't reproduce it in the test runner.

24bit loaded images have these get_masks()...
(255, 65280, 16711680, 0)

32bit images after surf.convert() have these get_masks()
(16711680, 65280, 255, 0)


However!
when I create a surface like...
depth = 24
surf = pygame.Surface((90, 90), 0, depth)

>>> surf.get_masks()
(16711680, 65280, 255, 0)

The same mask as the surf.convert() but *not* the same as the
pygame.image.load("file.jpg") surface.



So maybe the image loading function is putting the incorrect masks on
the loaded images... except the loaded images seem to blit ok.


So I'm a bit confused.


The test is here (it doesn't fail):
test/transform_test.py
    def test_average_surfaces__24(self):