2017-01-30 68 views
1

我使用plupload將照片上傳到Blobstore。該BlobInfo object有一些元數據檢索保存到Blobstore的照片的元數據

content_type: The content type of the blob. 
creation: The creation date of the blob, or when it was uploaded. 
filename: The file name that the user selected from their machine. 
size: The size of the uncompressed blob. 
md5_hash: The MD5 hash value of the uploaded blob. 

我的問題是怎樣才能得到照片的其他元數據無論是從plupload或服務器端?具體來說,我需要檢索一個「description」元數據字段。

回答

1

我會用exif-py如下:

blob_reader = blobstore.BlobReader(blob_key) 
blob_reader_data = StringIO.StringIO(blob_reader.read()) 
tags = exifread.process_file(blob_reader_data) 

標籤對象返回包含你正在尋找的元數據。