Hi Andrew,

I don't know whether you saw this:

http://www.web2pyslices.com/main/slices/take_slice/62

Some of that code was definitely working OK,  so you might be able to
learn from it.  Anyhow,  I hope it helps.

-David

On Dec 15, 7:44 pm, Andrew Evans <randra...@gmail.com> wrote:
> I have been looking into how to resize images on the fly. For some reason my
> code isn't working
>
> my controller consists of the following code
>
> def myImage():
>     if len(request.args) == 1:
>         return response.download(request, db)
>     else:
>         im = request.args(0)
>         im = os.path.join(request.folder, "uploads", im)
>         width = request.args(1)
>         height = request.args(2)
>         size = width, height
>         myImage = Image.open(im)
>
>     resized_image = myImage.thumbnail((size), Image.ANTIALIAS)
>     resized_image.save(myImage.format)
>     return resized_image
>
> The width and height I am passing as arguments from view what am I doing
> wrong with my image resize code....
>
> Any ideas
>
> *cheers

Reply via email to