Google App Engine PIL lib TypeError: object of type 'Image' has no len() -


i want crop image using images library of google app engine. code part using following.

                key = self.request.get("blobkey")                 img = images.image(str(key))                 images.crop(img,0.0,0.0,0.5,0.5)                 resim = img.execute_transforms(output_encoding=images.png)          content = {         }          self.response.headers['content-type'] = "image/png"         self.response.out.write(resim) 

but when try crop image, gives such error.

                typeerror: object of type 'image' has no len() 

is there knows error or there other way can crop image in python?

thanks in advance..

looking @ image documentation

class image(image_data=none, blob_key=none) 

you forgot specify blob_key name parameter calling image constructor:

key = self.request.get("blobkey") img = images.image(blob_key = str(key)) #you should specify blob_key images.crop(img,0.0,0.0,0.5,0.5) resim = img.execute_transforms(output_encoding=images.png) 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -