Git Product home page Git Product logo

Comments (7)

illume avatar illume commented on May 16, 2024

Original comment by Thomas Kluyver (Bitbucket: takluyver, GitHub: takluyver):


Removing version: unspecified (automated comment)

from pygame.

illume avatar illume commented on May 16, 2024

Original comment by René Dudfield (Bitbucket: illume, GitHub: illume):


Merged in OPiMedia/pygame (pull request #30)

Bug fix: Red and green channels inversion on AMD 64 (see issue #39).

from pygame.

illume avatar illume commented on May 16, 2024

Original comment by René Dudfield (Bitbucket: illume, GitHub: illume):


Bug fix: Red and green channels inversion on AMD 64 (see issue #39).

from pygame.

illume avatar illume commented on May 16, 2024

Original comment by René Dudfield (Bitbucket: illume, GitHub: illume):


Merged in OPiMedia/pygame (pull request #30)

Bug fix: Red and green channels inversion on AMD 64 (see issue #39).

from pygame.

illume avatar illume commented on May 16, 2024

Original comment by Olivier Pirson (Bitbucket: OPiMedia, GitHub: OPiMedia):


I have the same problem (save PNG reverse channels) with this configuration:

  • Debian Wheezy AMD 64
  • Python 3.2.3 (default, Feb 20 2013, 14:44:27) [GCC 4.7.2]
  • Pygame 1.9.2a0

It's ok with:

  • Python 2.7.3 (default, Mar 13 2014, 11:03:55) [GCC 4.7.2]
  • Pygame 1.9.1release

from pygame.

illume avatar illume commented on May 16, 2024

Original comment by René Dudfield (Bitbucket: illume, GitHub: illume):


Fixed SDL_BIG_ENDIAN bug for png write. Fixes and closes #39

from pygame.

illume avatar illume commented on May 16, 2024

Original comment by René Dudfield (Bitbucket: illume, GitHub: illume):


Thanks Jens.

Here is the test code inline the comment to make it easier to see.

import pygame, os
from pygame.locals import *

# Set SDL to use the dummy NULL video driver,
#   so it doesn't need a windowing system.
os.environ["SDL_VIDEODRIVER"] = "dummy"

if True:
    # Some platforms need to init the display for some parts of pygame.
    import pygame.display
    pygame.display.init()
    screen = pygame.display.set_mode((1,1))

def main():
    test = pygame.Surface((256, 256), flags=SRCALPHA, depth=32)
    for y in xrange(256):
        for x in xrange(256):
            test.set_at((x, y), (x,y,(x + y) % 256, (((x ^ y) >> 4) & 1) * 127 + 128))
    for ext in ["tga", "png", "bmp", "jpg"]:
        pygame.image.save(test, "test.%s" % ext)

if __name__ == "__main__":
    main()

It seems the set_at() call does some bit fiddling, which I'm weary of.

Also need to confirm this fails on PPC, which I don't have access too test on.

The test could be changed to read the lossless formats like tga, png and bmp to make sure they read back the colours correctly. Then this could be used as a unit test easily.

from pygame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.