我希望能够调整图像Blob的大小,然后再使用Google App Engine将其保存到数据库中from google.appengine.api import imagesfrom google.appengine.ext import blobstorefrom google.appengine.ext.webapp import blobstore_handlersfrom google.appengine.ext import dbclass ImageModel(db.Model): image1 = blobstore.BlobReferencePropert(required = True)class UploadImageHandler(BaseHandler, blobstore_handlers.BlobstoreUploadHandler): def post(self): upload_files = self.get_uploads('image1') blob_info = upload_files[0] blob_key = blob_info.key() img = images.Image(blob_key = blob_key) img.resize(width = 500, height = 500) i = ImageModel(image1 = img) i.put()当然,这是行不通的,因为img不再是Blob。如何将图像转换回Blob,然后上传到数据库。我不想动态提供图片并调整大小。我需要在数据库中调整图像大小。
添加回答
举报
0/150
提交
取消