Kevin Dangoor wrote:
Ahh, OK.
The basic idea would be something like this
@turbogears.expose()
def myimg_jpg(self):
# get your image
# set cherrypy.response.headerMap["Content-Type"]
# set cherrypy.response.body
Then, in the page that needs to include the image, you would just say
<img src="myimg.jpg"/>
(Note that the "." gets converted to an _ for python.)
For more specific details, you should take a look at what the cherrypy
serveFile function does:
http://www.turbogears.org/docs/api/source/cherrypy.lib.cptools-module.html#213
Kevin
On 10/5/05, Leonardo <[EMAIL PROTECTED]> wrote:
Hi Kevin =D
thank for help-me..
but i access image in DataBase or buffer and i not have image saved in
disk ?
how to make it?
thaks for help =D
[],s Léo
--
Kevin Dangoor
Author of the Zesty News RSS newsreader
email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com
I'm thinking of doing something like this to keep me from having to use
a static file directory so that I can serve up images wherever on the
hard drive I happen to put them and have permissions. Yes, there are
security concerns with that. Yes, there are probably performance
concerns with that as well. But I was also thinking of filtering them
through PIL or something comparable to do rotations based on EXIF data.
And this is a single user app. And I typically run it on the machine I
happen to be on, so this kind of outweighs the concerns. This is really
cool! I'll try it when I get a minute. Thanks, Kevin!
- jmj