Right now when I try to use it it tells me a number is required... Huh?
And if I statically set w and h it doesn't download the iamges.
What am I missing here to make this work?
---
def image():
if len(request.args) == 1:
#nothing to change, just give the full image
return response.download(request, db)
else:
import Image
import os
image_file = request.args[0]
image_file = os.path.join(request.folder, "uploads", image_file)
width = request.args[1]
height = request.args[2]
image_file=Image.open(image_file)
w = image_file.size[0]
h = image_file.size[1]
if width==0 and height!=0:
w=height*w/h
h=height
elif height==0 and width!=0:
h=width*h/w
w=width
else:
w=width
h=height
resized_image = image_file.resize((w,h),Image.ANTIALIAS)
return resized_image
---
Best Regards,
Jason Brower