I managed to store a picture in the Google App engine blob (I can see it in the Blob Viewer from the dashboard, and also in my app using a serving handler).. However, now that i have this picture there..i want to resize it while serving it to the client...Problem is that i can't do that...I can't make an Image out of that blob...This is my code :
from google.appengine.api import images from google.appengine.ext import blobstore from google.appengine.ext.webapp import blobstore_handlers .... class Image(webapp2.RequestHandler): def get(self,id): product = Product.by_id(int(id)) logging.info('pic key is' + str(product.small_pic.key())) img = images.Image(blob_key=str(product.small_pic.key())) img.im_feeling_lucky() # do a transform, otherwise GAE complains. img.execute_transforms(output_encoding=images.JPEG,quality=1) if img: self.response.headers['Content-Type'] = 'image/png' self.response.out.write(img) else: self.error(404) The code from above is taken from this thread : GAE: How to get the blob-image height
When i run the code from above ex /img/373 i get the error :
The image "http:..../img/373" cannot be displayed because it contains errors How can i do this ?..What i want is to find out way to transform that blob in an image and then process the image...