Issue #48 open

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

illume
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())

1334

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 (4)

  1. Log in to comment