on GAE i use: def download(): ...do stuff return img.execute_transforms(images.JPEG)
where the google image object (img) returns a binary stream as a result of execute_transforms. if you return just binary data from a controller function in web2py, web2py does nothing more to the return, it just streams it to the user. hope that helps. cfh On Jun 13, 10:20 pm, Jason Brower <[email protected]> wrote: > Yeah I like that approach. I just can't figure out how to make a file > like object like this images from PIL to be returned and actually > work. :/ Something my brain can fathom. > Best Regards, > Jason > > On Sun, 2010-06-13 at 17:37 -0700, howesc wrote: > > create a function for serving images, and add the sizes as parameters: > > <img src="http://mysite.com/applciation/images/download/foo.png/ > > 300/400" /> > > > and in the function do the resize and output the binary data of the > > image. > > > i'm not 100% sure of the best way to do it out side of google app > > engine (because they have a special image manipulation library), but i > > can share some code i used on google app engine to retrieve an image > > from blobstore, resize, and send to client if you think that will help > > you. > > > cfh > > > On Jun 13, 1:41 am, Jason Brower <[email protected]> wrote: > > > I want to use PIL to change images to be smaller so they render faster, > > > I could do it like this where they are entered into a database and > > > uploaded, but I have up to 8 different sizes to work with,and with a > > > constantly changing design, it would be difficult to make the database > > > changes as well. > > > This was the example I found but it uses the database and a second > > > upload.http://groups.google.com/group/web2py/browse_frm/thread/e2640890d99cf... > > > > I would like to make it so I can pass a function the file location > > > db.stuff.photo and it would return something I could pass to the view. > > > Hepe that makes sence. > > > Best Regards, > > > Jason Brower

