Maybe I'm a bit confused on how to generate/stream the image, given the
buffer. The following should work, right?
def render_image():
return Image.open(request.vars.image_buffer)
...
img_buffer = io.BytesIO()
pylab.savefig(img_buffer, format = 'png')
img_buffer.seek(0)Enter code here...
return dict(img = IMG(_src=URL('render_image', vars=dict(image_buffer =
img_buffer)), _alt = 'image buffer not displaying'))
Or is there something other than Image.open() that's a better solution?
On Monday, July 8, 2013 1:04:38 PM UTC-5, Anthony wrote:
>
>
> On Monday, July 8, 2013 12:49:19 PM UTC-5, Anthony wrote:
>>>
>>> The IMG() helper simply creates an HTML <img> element to be displayed in
>>> the browser. The "src" attribute of an image element should be a URL where
>>> the browser can request the image. You cannot pass an actual image file
>>> object to the helper.
>>
>>
> Just make the "src" URL an action that generates the image and streams it.
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.