2008/10/8 T. Mohr <public1@...>:
> In PHP I used the GD library to create an image and return it as content
> type "image/png" to the browser.
> Is there a simple way to do something similar using Spyce (maybe with
> the PIL library)?
Yes, you just need something like:
Where png_image_data contains the PNG file contents. To get this from
PIL you can save your image to a StringIO buffer, eg:
buffer = StringIO.StringIO()
png_image_data = buffer.getvalue()
PIL is a good image library and probably what I'd use, but there are
alternatives. If you're familiar with GD you might find this binding
easier (I haven't tried it myself):
Hope this helps,