1. pygame
  2. pygame
  3. pygame
  4. Issues


Issue #48 open

Add optional 'format' argument to pygame.image.save

René Dudfield
created an issue

== Arnau Sanchez, 2010-05-19 11:22:25 -0700

{{{ Sometimes we need to store a surface image into a string instead of a filename. I tested with StringIO and it worked:

import StringIO fd = StringIO.StringIO() pygame.image.save(surface, fd) print len(fd.getvalue())


However, since we have no real filename, we cannot set the file format. That's why I propose to add a third optional argument that forces the function to use a given format:

pygame.image.save(Surface, filename, format="TGA"): return None }}}

Comments (6)

  1. Log in to comment