class GetPic2(webapp.RequestHandler):
def get(self, pic_id):
pic = WCPicture.gql("where id = :1", int(pic_id)).get()
if pic:
w = self.request.get("w")
h = self.request.get("h")
raw_img = images.Image(urlfetch.Fetch("/WebcamCapture/getPic/" + pic_id).content)
if w<>"" and h<>"":
raw_img.resize(width=int(w), height=int(h))
raw_img.im_feeling_lucky()
self.response.headers['Content-Type'] = 'image/png'
self.response.out.write(raw_img.execute_transforms(output_encoding=images.PNG))