You can use cairo (http://cairographics.org/pycairo/) to serve dynamic
drawn images.
@expose(content_type = "image/png")
def dynamic_image(self, width=200, height=200):
pic_buffer = cStringIO.StringIO()
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
ctx = cairo.Context(surface)
...
draw something on ctx
...
surface.write_to_png(pic_buffer)
return pic_buffer.getvalue()
Marko
Min schrieb:
> How do I serve up images that sit on the server's hard drive, but not
> in the static folder?
>
> I've begun porting over a TG1 site to TG2, and I always used to use
> CherryPy's serveFile function to do this, but I haven't been able to
> find an equivalent for Pylons.
>
> Alternatively, what are some other common ways people use to serve up
> dynamically generated images?
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---