我使用下面的代碼成功發佈到我的谷歌AppEngine應用程式的圖像來調整圖片的大小:GAE(AppEngine上)出現在發佈
def post(self):
image_data = self.request.get('file')
file_name = files.blobstore.create(mime_type='image/png')
# Open the file and write to it
with files.open(file_name, 'a', exclusive_lock=True) as f:
f.write(image_data)
# Finalize the file. Do this before attempting to read it.
files.finalize(file_name)
# Get the file's blob key
blob_key = files.blobstore.get_blob_key(file_name)
self.response.out.write(images.get_serving_url(blob_key))
然而,當我瀏覽通過get_serving_url()
,在輸出的URL圖像是總是在降低分辨率。 爲什麼?我檢查並重複檢查發佈的圖像尺寸是否正確(來自iPhone相機,因此約爲3200x2400分辨率)。然而,服務的圖像始終是512x384。
我對GAE相當陌生,但我認爲上面的代碼應該將圖像存儲在BlobStore而不是數據存儲區中,從而規避1 MB的限制。
有沒有人有任何想法會發生什麼?
乾杯, 佈雷特
= s0將服務於原始大小 – Greg 2012-08-08 17:42:30